-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython condition
More file actions
52 lines (39 loc) · 800 Bytes
/
python condition
File metadata and controls
52 lines (39 loc) · 800 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
#If condition
a =100
b = 100
if a>b:
print (a,'Greater than ', b)
elif b>a:
print (b,'Greater than',a)
else:
print (a,'and ',b ,'are equal')
#If condition Between
a =300
if a <100:
print (a,'Less than 100')
elif (100<= a <=200):
print (a,'is between 100 and 200')
else:
print (a,'Greater than 200')
#While loop
a =1
while a <5:
print ( 'The number is ',a)
a+=1
print ('Program end')
for i in range (10):
print (str(i)*i)
print ('Good Day')
#Example 2
A = ['Pen','Pencil','Book','Toy']
B = ['School', 'College']
for i in A:
print (i)
for j in B:
print(' ',j)
#Input Parameter
no1 = input ('Enter the value')
no2 = input ('Enter the value')
print ('Data type of no1 ',type (no1))
no3 = int(no1)+ int (no2)
print (no3)