-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConrtolFlowStatement.py
More file actions
81 lines (59 loc) · 1.09 KB
/
ConrtolFlowStatement.py
File metadata and controls
81 lines (59 loc) · 1.09 KB
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
#if
if 10>5:
print("!0 is greater ")
#if else
a=20
n=int(input("Enter number "))
if a>n:
print(a,"is greatre ")
else :
print(a,"is smaller")
#elif
if n>0:
print("Positive number ")
elif n==0 :
print("Number is zero")
else :
print("Nigative number")
#for loop
number=[1,2,3,6,5,6,7,8,9]
sum=0
num=0
for num in number:
sum=sum+num
print("sum : ",sum)
#range ()
print("Range Seque ",range(10))
print("Range sequanse allitems is ",list(range(10)))
#while loop
s=0
i=1
b=700
while i<=b:
s=s+i
i=i+1
print("sum = ",s)
#brak
if 10<5:
pass
for b in "hello python" :
if b=='y':
break
print(b)
#continu
for b in "hello python" :
if b=='y':
continue
print(b)
#pass
list = [1,2,3,4,5]
flag = 0
for i in list:
print("Current element:",i,end=" ");
if i==3:
pass;
print("\nWe are inside pass block\n");
flag = 1
if flag==1:
print("\nCame out of pass\n");
flag=0;