Skip to content

Commit 5098d97

Browse files
committed
add kr do bhai
1 parent 64ab477 commit 5098d97

6 files changed

+62
-0
lines changed

section5/else_suite.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
count=5
2+
while count <=10:
3+
print (count)
4+
count+=1
5+
else :
6+
print ('printed all the number which are 10')
7+
print('end of the program')
8+
9+
# if i brack a statement
10+
11+
count=5
12+
while count <=10:
13+
print (count)
14+
count+=1
15+
16+
if count > 5:
17+
break
18+
else :
19+
print ('printed all the number which are 10')
20+
print('end of the program')

section5/else_suite_brack.py

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
count=1
2+
while count <=10:
3+
print (count)
4+
count+=1
5+
if count > 5:
6+
break
7+
else :
8+
print ('printed all the number which are 10')
9+
print('end of the program')
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
n=int(input('enter a number'))
2+
fact =1
3+
for count in range (1 , n+1):
4+
fact =fact*count
5+
print('factorial of ',n,'is',fact)

section5/foor_loop.py

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
msg='rajeev'
2+
for x in msg :
3+
print(x)
4+
5+
# each line for given sequance
6+
# collection of value is sequance
7+
8+
# for each element in sequance
9+
10+
# output
11+
# r
12+
# a
13+
# j
14+
# e
15+
# e
16+
# v
17+

section5/foor_loop_in_range.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
for i in range(0,10 ,3):
2+
print (i)
3+
4+
5+

section5/for_loop_challange.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
n=int(input('enter a number'))
2+
3+
for count in range (1,11):
4+
print(n, 'x',count,'=',count*n)
5+
6+

0 commit comments

Comments
 (0)