-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathP19Ifstatement1.py
More file actions
86 lines (67 loc) · 1.16 KB
/
P19Ifstatement1.py
File metadata and controls
86 lines (67 loc) · 1.16 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
""""#P19 CH. 4 Python conditional and iterative statements
#IF STATEMENT DEMO EXAMPLES
"""
print("----------------------------")
print ("IF STATEMENT USE")
print("""
a=100
b=10
if (a>b):
print("A GREATER THAN B")
""")
a=100
b=10
if (a>b):
print("A GREATER THAN B")
print("----------------------------")
print ("IF....ELSE STATEMENT USE")
print("""
a=100
b=10
if (a<b):
print("A IS LESS THAN B")
else:
print("A IS GREATER THAN B")
""")
a=100
b=10
if (a<b):
print("A IS LESS THAN B")
else:
print("A IS GREATER THAN B")
print("----------------------------")
print ("IF....ELIF STATEMENT USE")
print("""
a=10
b=10
if (a<b):
print("A IS LESS THAN B")
elif(a==b):
print("A IS EQUAL TO B")
OUTPUT:""")
a=10
b=10
if (a<b):
print("A IS LESS THAN B")
elif(a==b):
print("A IS EQUAL TO B")
print("----------------------------")
print ("IF....ELIF....ELSE STATEMENT USE")
print("""
a=10
b=10
if (a<b):
print("A IS LESS THAN B")
elif(a>b):
print("A GREATER THAN B")
else:
print("BOTH ARE EQUAL")
OUTPUT:""")
a=10
b=10
if (a<b):
print("A IS LESS THAN B")
elif(a>b):
print("A GREATER THAN B")
else:
print("BOTH ARE EQUAL")