-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathwhileloop.py
More file actions
55 lines (46 loc) · 829 Bytes
/
whileloop.py
File metadata and controls
55 lines (46 loc) · 829 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#continue
i = 0
str1 = 'pythonprogramming'
while i < len(str1):
if str1[i] == 'm' or str1[i] == 'g':
i += 1
continue
print('Current Letter : ', str1[i])
i += 1
#break
print("demo of break")
i = 0
str1 = 'pythonprogramming'
while i < len(str1):
if str1[i] == 't':
i += 1
break
print('Current Letter : ', str1[i])
i += 1
#pass
print("demo of pass")
i = 0
str1 = 'pythonprogramming'
while i < len(str1):
i += 1
pass
print('Value of i : ', i)
#exp-1
i=1
while(i<=10):
print(i)
i=i+1
#exp=2
i=1
num = 0
b = 9
num = int(input("enter the number"))
while i<=10:
print("%d X %d = %d \n"%(num,i,num*i))
i = i+1
i = 1
while(i<=5):
print(i)
i=i+1
else:
print("the while loop exhausted")