-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathassignment 03 usage of break, continue and pass.py
41 lines (33 loc) · 1.28 KB
/
assignment 03 usage of break, continue and pass.py
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
# 3. Demonstrate the usage of break, continue and pass statements
# break
start=int(input("the starting value is = "))
print("Notes : please give the break number below ending value")
bre=int(input("in which place you want to break = "))
end=int(input("enter the ending value = "))
for i in range(start,end+1):
if i ==bre:
print("i have give contision to break ")
break
print(i)
#----------------------------------------------------------------------------#
# continue
start=int(input("the starting value is = "))
print("Notes : please give the skip number below ending value")
con=int(input("in which place you want to skip = "))
end=int(input("enter the ending value = "))
for i in range(start,end+1):
if i ==con:
print("the value is skiped")
continue
print(i)
#----------------------------------------------------------------------------#
# pass
start=int(input("Enter the starting value = "))
s_err=int(input("Enter the remove-start value : "))
e_err=int(input("Enter the remove-end value : "))
end=int(input("Enter the endting value = "))
for i in range(start,end+1):
if i not in range(s_err,e_err+1):
print(i)
pass
#----------------------------------------------------------------------------#