SlideShare a Scribd company logo
Lecture 3.1 python loop 1 (ewurc)
Python
Lecture 3.1
Problem Set 3: Loop
Topic
• Loop Statement
• Operator
• Assignment Operator
• Membership Operator
• Problem Set 3: Loop (28)
Conditional Statement Syntax
• while condition:
#statement
• for element in range(start, end, increment):
#statement
Print Series: 1,2,3,4,………,N
n = int(input())
i = 1
while i <= n:
print(i)
i=i+1
Print Series: 1,2,3,4,………,N [2]
n = int(input())
i = 1
while i <= n:
print(i, end = " ")
i=i+1
Print Series: 1,2,3,4,………,N [3]
n = int(input())
for i in range(n):
print(i, end=" ")
Print Series: 1,2,3,4,………,N [4]
n = int(input())
for i in range(1,n+1):
print(i, end=" ")
Print Series: 1,2,3,4,………,N [5]
n = int(input())
for i in range(2,n+1,2):
print(i, end=" ")
Print Series: 1,2,3,4,………,N [6]
n = int(input())
for i in range(n,0,-2):
print(i, end=" ")
Print Series: 1,1,2,3,5,8,13,21,34,………,N
n = 15
f = []
f.append(0)
f.append(1)
i = 2
while i<=n:
f.append(f[i-1]+f[i-2])
i = i + 1
for i in range(n+1):
print(f[i])
Print Series: 1,2,3,4,………,N [6]
n = 5
for i in range(1,11):
print(n,"*",i,"=",n*i)
for i in range(1,11):
print(f"{n:2} * {i:2} = {n*i:3}")
Assignment Operator
• =
• +=
• -=
• *=
• /=
• %=
• //=
Membership Operator
• in
• not in
Problem Set 3.1: Loop (15)
• 1,2,3,4,………,N
• 1,3,5,7,………,N
• 2,4,6,8,………,100
• 1,1,2,3,5,8,13,21,34,………,N
• Make Multiplication table of N
• Pattern Print (10)
Any Question?
Prepared by
Mun Al Mamun
President
East West University Robotics Club
munewu@gmail.com
T h i s s l i d e i s p r o v i d e a s a c o u r s e
m a t e r i a l i n t h e w o r k s h o p
“ W o r k s h o p O n P y t h o n P r o g r a m m i n g ”
O r g a n i z e d b y
E a s t W e s t U n i v e r s i t y R o b o t i c s C l u b
Ad

Recommended

Lecture 0 python basic (ewurc)
Lecture 0 python basic (ewurc)
Al-Mamun Riyadh (Mun)
 
Lecture 5 python function (ewurc)
Lecture 5 python function (ewurc)
Al-Mamun Riyadh (Mun)
 
loops python.pdf
loops python.pdf
MUHAMMED MASHAHIL PUKKUNNUMMAL
 
Looping
Looping
MuhammadBakri13
 
2 Python Basics II meeting 2 tunghai university pdf
2 Python Basics II meeting 2 tunghai university pdf
Anggi Andriyadi
 
For Loops and Nesting in Python
For Loops and Nesting in Python
primeteacher32
 
Iterations FOR LOOP AND WHILE LOOP .pptx
Iterations FOR LOOP AND WHILE LOOP .pptx
VijayaLakshmi948042
 
Mastering Python lesson3b_for_loops
Mastering Python lesson3b_for_loops
Ruth Marvin
 
COneShotPart3.pdf1111111111111111111111111
COneShotPart3.pdf1111111111111111111111111
komitag811
 
Python notes for students to learn and develop
Python notes for students to learn and develop
kavithaadhilakshmi
 
Matlab Script - Loop Control
Matlab Script - Loop Control
Shameer Ahmed Koya
 
03 control
03 control
Massoud Hamad
 
Pythonic Math
Pythonic Math
Kirby Urner
 
011 LOOP.pdf cs project important chapters
011 LOOP.pdf cs project important chapters
AryanRajak
 
Mastering Python lesson 3a
Mastering Python lesson 3a
Ruth Marvin
 
GE3151_PSPP_UNIT_3_Notes
GE3151_PSPP_UNIT_3_Notes
Guru Nanak Technical Institutions
 
Python_Module_2.pdf
Python_Module_2.pdf
R.K.College of engg & Tech
 
Problem solving using computers - Unit 1 - Study material
Problem solving using computers - Unit 1 - Study material
To Sum It Up
 
Mementopython3 english
Mementopython3 english
yassminkhaldi1
 
classVII_Coding_Teacher_Presentation.pptx
classVII_Coding_Teacher_Presentation.pptx
ssusere336f4
 
Introduction to python cheat sheet for all
Introduction to python cheat sheet for all
shwetakushwaha45
 
Class 12 , computer 2 Python loop if-1.pptx
Class 12 , computer 2 Python loop if-1.pptx
rajaryash2
 
Dr.nouh part summery
Dr.nouh part summery
عمر محمد
 
Python programming workshop session 2
Python programming workshop session 2
Abdul Haseeb
 
Python week 7 8 2019-2020 for g10 by eng.osama ghandour
Python week 7 8 2019-2020 for g10 by eng.osama ghandour
Osama Ghandour Geris
 
Mementopython3 english
Mementopython3 english
ssuser442080
 
Python3
Python3
Sourodip Kundu
 
Python3 cheatsheet
Python3 cheatsheet
Gil Cohen
 
Lecture 1 python arithmetic (ewurc)
Lecture 1 python arithmetic (ewurc)
Al-Mamun Riyadh (Mun)
 
Prime Number (Sieve)
Prime Number (Sieve)
Al-Mamun Riyadh (Mun)
 

More Related Content

Similar to Lecture 3.1 python loop 1 (ewurc) (20)

COneShotPart3.pdf1111111111111111111111111
COneShotPart3.pdf1111111111111111111111111
komitag811
 
Python notes for students to learn and develop
Python notes for students to learn and develop
kavithaadhilakshmi
 
Matlab Script - Loop Control
Matlab Script - Loop Control
Shameer Ahmed Koya
 
03 control
03 control
Massoud Hamad
 
Pythonic Math
Pythonic Math
Kirby Urner
 
011 LOOP.pdf cs project important chapters
011 LOOP.pdf cs project important chapters
AryanRajak
 
Mastering Python lesson 3a
Mastering Python lesson 3a
Ruth Marvin
 
GE3151_PSPP_UNIT_3_Notes
GE3151_PSPP_UNIT_3_Notes
Guru Nanak Technical Institutions
 
Python_Module_2.pdf
Python_Module_2.pdf
R.K.College of engg & Tech
 
Problem solving using computers - Unit 1 - Study material
Problem solving using computers - Unit 1 - Study material
To Sum It Up
 
Mementopython3 english
Mementopython3 english
yassminkhaldi1
 
classVII_Coding_Teacher_Presentation.pptx
classVII_Coding_Teacher_Presentation.pptx
ssusere336f4
 
Introduction to python cheat sheet for all
Introduction to python cheat sheet for all
shwetakushwaha45
 
Class 12 , computer 2 Python loop if-1.pptx
Class 12 , computer 2 Python loop if-1.pptx
rajaryash2
 
Dr.nouh part summery
Dr.nouh part summery
عمر محمد
 
Python programming workshop session 2
Python programming workshop session 2
Abdul Haseeb
 
Python week 7 8 2019-2020 for g10 by eng.osama ghandour
Python week 7 8 2019-2020 for g10 by eng.osama ghandour
Osama Ghandour Geris
 
Mementopython3 english
Mementopython3 english
ssuser442080
 
Python3
Python3
Sourodip Kundu
 
Python3 cheatsheet
Python3 cheatsheet
Gil Cohen
 
COneShotPart3.pdf1111111111111111111111111
COneShotPart3.pdf1111111111111111111111111
komitag811
 
Python notes for students to learn and develop
Python notes for students to learn and develop
kavithaadhilakshmi
 
011 LOOP.pdf cs project important chapters
011 LOOP.pdf cs project important chapters
AryanRajak
 
Mastering Python lesson 3a
Mastering Python lesson 3a
Ruth Marvin
 
Problem solving using computers - Unit 1 - Study material
Problem solving using computers - Unit 1 - Study material
To Sum It Up
 
Mementopython3 english
Mementopython3 english
yassminkhaldi1
 
classVII_Coding_Teacher_Presentation.pptx
classVII_Coding_Teacher_Presentation.pptx
ssusere336f4
 
Introduction to python cheat sheet for all
Introduction to python cheat sheet for all
shwetakushwaha45
 
Class 12 , computer 2 Python loop if-1.pptx
Class 12 , computer 2 Python loop if-1.pptx
rajaryash2
 
Python programming workshop session 2
Python programming workshop session 2
Abdul Haseeb
 
Python week 7 8 2019-2020 for g10 by eng.osama ghandour
Python week 7 8 2019-2020 for g10 by eng.osama ghandour
Osama Ghandour Geris
 
Mementopython3 english
Mementopython3 english
ssuser442080
 
Python3 cheatsheet
Python3 cheatsheet
Gil Cohen
 

More from Al-Mamun Riyadh (Mun) (6)

Lecture 1 python arithmetic (ewurc)
Lecture 1 python arithmetic (ewurc)
Al-Mamun Riyadh (Mun)
 
Prime Number (Sieve)
Prime Number (Sieve)
Al-Mamun Riyadh (Mun)
 
Workshop on arduino (ewurc)
Workshop on arduino (ewurc)
Al-Mamun Riyadh (Mun)
 
Lecture 6 python oop (ewurc)
Lecture 6 python oop (ewurc)
Al-Mamun Riyadh (Mun)
 
Lecture 4 python string (ewurc)
Lecture 4 python string (ewurc)
Al-Mamun Riyadh (Mun)
 
Lecture 2 python conditional (ewurc)
Lecture 2 python conditional (ewurc)
Al-Mamun Riyadh (Mun)
 
Ad

Recently uploaded (20)

Values Education 10 Quarter 1 Module .pptx
Values Education 10 Quarter 1 Module .pptx
JBPafin
 
Filipino 9 Maikling Kwento Ang Ama Panitikang Asiyano
Filipino 9 Maikling Kwento Ang Ama Panitikang Asiyano
sumadsadjelly121997
 
Wage and Salary Computation.ppt.......,x
Wage and Salary Computation.ppt.......,x
JosalitoPalacio
 
Q1_TLE 8_Week 1- Day 1 tools and equipment
Q1_TLE 8_Week 1- Day 1 tools and equipment
clairenotado3
 
Photo chemistry Power Point Presentation
Photo chemistry Power Point Presentation
mprpgcwa2024
 
2025 June Year 9 Presentation: Subject selection.pptx
2025 June Year 9 Presentation: Subject selection.pptx
mansk2
 
LDMMIA Yoga S10 Free Workshop Grad Level
LDMMIA Yoga S10 Free Workshop Grad Level
LDM & Mia eStudios
 
2025 Completing the Pre-SET Plan Form.pptx
2025 Completing the Pre-SET Plan Form.pptx
mansk2
 
CRYPTO TRADING COURSE BY FINANCEWORLD.IO
CRYPTO TRADING COURSE BY FINANCEWORLD.IO
AndrewBorisenko3
 
Birnagar High School Platinum Jubilee Quiz.pptx
Birnagar High School Platinum Jubilee Quiz.pptx
Sourav Kr Podder
 
Code Profiling in Odoo 18 - Odoo 18 Slides
Code Profiling in Odoo 18 - Odoo 18 Slides
Celine George
 
June 2025 Progress Update With Board Call_In process.pptx
June 2025 Progress Update With Board Call_In process.pptx
International Society of Service Innovation Professionals
 
M&A5 Q1 1 differentiate evolving early Philippine conventional and contempora...
M&A5 Q1 1 differentiate evolving early Philippine conventional and contempora...
ErlizaRosete
 
NSUMD_M1 Library Orientation_June 11, 2025.pptx
NSUMD_M1 Library Orientation_June 11, 2025.pptx
Julie Sarpy
 
How to Customize Quotation Layouts in Odoo 18
How to Customize Quotation Layouts in Odoo 18
Celine George
 
K12 Tableau User Group virtual event June 18, 2025
K12 Tableau User Group virtual event June 18, 2025
dogden2
 
Gladiolous Cultivation practices by AKL.pdf
Gladiolous Cultivation practices by AKL.pdf
kushallamichhame
 
GREAT QUIZ EXCHANGE 2025 - GENERAL QUIZ.pptx
GREAT QUIZ EXCHANGE 2025 - GENERAL QUIZ.pptx
Ronisha Das
 
List View Components in Odoo 18 - Odoo Slides
List View Components in Odoo 18 - Odoo Slides
Celine George
 
Learning Styles Inventory for Senior High School Students
Learning Styles Inventory for Senior High School Students
Thelma Villaflores
 
Values Education 10 Quarter 1 Module .pptx
Values Education 10 Quarter 1 Module .pptx
JBPafin
 
Filipino 9 Maikling Kwento Ang Ama Panitikang Asiyano
Filipino 9 Maikling Kwento Ang Ama Panitikang Asiyano
sumadsadjelly121997
 
Wage and Salary Computation.ppt.......,x
Wage and Salary Computation.ppt.......,x
JosalitoPalacio
 
Q1_TLE 8_Week 1- Day 1 tools and equipment
Q1_TLE 8_Week 1- Day 1 tools and equipment
clairenotado3
 
Photo chemistry Power Point Presentation
Photo chemistry Power Point Presentation
mprpgcwa2024
 
2025 June Year 9 Presentation: Subject selection.pptx
2025 June Year 9 Presentation: Subject selection.pptx
mansk2
 
LDMMIA Yoga S10 Free Workshop Grad Level
LDMMIA Yoga S10 Free Workshop Grad Level
LDM & Mia eStudios
 
2025 Completing the Pre-SET Plan Form.pptx
2025 Completing the Pre-SET Plan Form.pptx
mansk2
 
CRYPTO TRADING COURSE BY FINANCEWORLD.IO
CRYPTO TRADING COURSE BY FINANCEWORLD.IO
AndrewBorisenko3
 
Birnagar High School Platinum Jubilee Quiz.pptx
Birnagar High School Platinum Jubilee Quiz.pptx
Sourav Kr Podder
 
Code Profiling in Odoo 18 - Odoo 18 Slides
Code Profiling in Odoo 18 - Odoo 18 Slides
Celine George
 
M&A5 Q1 1 differentiate evolving early Philippine conventional and contempora...
M&A5 Q1 1 differentiate evolving early Philippine conventional and contempora...
ErlizaRosete
 
NSUMD_M1 Library Orientation_June 11, 2025.pptx
NSUMD_M1 Library Orientation_June 11, 2025.pptx
Julie Sarpy
 
How to Customize Quotation Layouts in Odoo 18
How to Customize Quotation Layouts in Odoo 18
Celine George
 
K12 Tableau User Group virtual event June 18, 2025
K12 Tableau User Group virtual event June 18, 2025
dogden2
 
Gladiolous Cultivation practices by AKL.pdf
Gladiolous Cultivation practices by AKL.pdf
kushallamichhame
 
GREAT QUIZ EXCHANGE 2025 - GENERAL QUIZ.pptx
GREAT QUIZ EXCHANGE 2025 - GENERAL QUIZ.pptx
Ronisha Das
 
List View Components in Odoo 18 - Odoo Slides
List View Components in Odoo 18 - Odoo Slides
Celine George
 
Learning Styles Inventory for Senior High School Students
Learning Styles Inventory for Senior High School Students
Thelma Villaflores
 
Ad

Lecture 3.1 python loop 1 (ewurc)