forked from hariom20singh/python-learning-codes
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLoops.py
More file actions
Latest commit
22 lines (21 loc) · 407 Bytes
/
Copy pathLoops.py
File metadata and controls
22 lines (21 loc) · 407 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#1 for loops
#--> for with range -
foriinrange(5):
print(i)
#this print 0 1 2 3 4
#--> for with range (start , stop , step)
print()
foriinrange(2,11,2):
print(i)
# print - 2 4 6 8 10
print()
#for with in - used to iterate different containers in python
a= [4,6,4 ,3,2]
foreleina :
print(ele)
#2.) while loops
cont=5
print()
whilecont>0 :
print(cont)
cont=cont-1