Skip to content

Commit 847408e

Browse files
Add files via upload
1 parent 0bde7cb commit 847408e

10 files changed

Lines changed: 84 additions & 0 deletions

5th day/break_statement.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# break statement
2+
i =1
3+
while i<= 10:
4+
if i ==5:
5+
break
6+
print(i)
7+
i +=1
8+
print("---------------------------------")
9+
for i in range(2,22,2):
10+
if i == 16:
11+
break
12+
print(i)

5th day/continue_statement.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# continue statemnet
2+
i =1
3+
while i <= 5:
4+
if i ==3:
5+
i+=1
6+
continue
7+
print(i)
8+
i +=1
9+
print("-------------------------")
10+
for i in range(1,11):
11+
if i==3:
12+
continue
13+
print(i)

5th day/f_loop_intger.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# for loop using for printing interger
2+
# range (start)
3+
for a in range(21):
4+
print(a)

5th day/f_loop_rrangeformone.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# we want to print that last number 25 so we take 26 because of n-1
2+
#range(start , end -1)
3+
for b in range(5 , 26):
4+
print(b)

5th day/f_loop_string.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# for loop
2+
for i in range(10):
3+
#block of code for for loop
4+
#print string
5+
print("Hello")

5th day/for_loop_range_step.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# for loop code for print 2 table code using range
2+
#end n-1 step =2 , 22-2= 20, 21 - 2 =18 , end-step)
3+
# range(start , end,steps)
4+
for i in range(3, 33 , 3):
5+
print(i)

5th day/pass_statement.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
i=1
2+
while i<=5:
3+
if i==3:
4+
pass
5+
print(i)
6+
i+=1

5th day/while_loop_integer.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# while loop:- uses when we know the condition
2+
i =1
3+
while i <=10:
4+
print(i)
5+
# as a increment
6+
i=i+1
7+
"""
8+
int i = 1;
9+
while i<=10
10+
{
11+
printf(i);
12+
i++;
13+
}
14+
"""

5th day/while_loop_string.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
i=1
2+
while i <=3:
3+
print("Hello")
4+
# use as a increment
5+
# work as i = i+1
6+
i +=1
7+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
text = "Hello"
2+
i = 0
3+
# we use len function for seeing , know the length of that praticular sting or paramter
4+
while i<len(text):
5+
print(text[i])
6+
i +=1
7+
#[]
8+
"""
9+
H = 0
10+
E = 1
11+
L = 2
12+
L = 3
13+
O = 4
14+
"""

0 commit comments

Comments
 (0)