-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path03rdLoopsinPython.py
More file actions
92 lines (60 loc) · 962 Bytes
/
03rdLoopsinPython.py
File metadata and controls
92 lines (60 loc) · 962 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# ! While Loop:
i = 10
while i!=0:
print('Hello')
i-=1
i = 10
while i!=20:
print(i)
if i == 15:
break
i+=1
i = 10
while i!=20:
if i == 15:
i+=1
print(i)
i+=1
i = 10
while i < 21:
if i>=15:
i+=1
print(i)
i+=1
print(100//6)
print(100%6)
# ! For Loops
for i in range(6):
print(i,end='')
print()
for i in 'python':
print(i)
a = 1
for i in range(9):
for j in range(1,4):
print(a,'\t',j)
a+=1
if a == 4:
break
for i in range(1,4):
for j in range(1,4):
print(i,'\t',j)
n = int(input())
while n!=0:
d = n % 10
print(d)
n//=10
n = int(input())
r = 0
while n!=0:
a=n%10
r *= 10 + a
n//=10
n = int(input('Enter a no. for checking if it is amstrong or not:'))
s = 0
while n!=0:
s = s + ((n%10)**3)
for i in range(1,6):
for j in range(i):
print(i,end='')
print()