-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path27.condition.py
More file actions
34 lines (30 loc) · 884 Bytes
/
27.condition.py
File metadata and controls
34 lines (30 loc) · 884 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
# Conditional Statements In Python
# if ... elif ... else
"""
# Equals: a == b
# Not Equals: a != b
# Less than: a < b
# Less than or equal to: a <= b
# Greater than: a > b
# Greater than or equal to: a >= b
"""
a= 25;
b= 50;
c= 75;
print("The values are: a= "+str(a)+", b="+str(b)+", c="+str(c))
print("if a > b print 'a is bigger than b'\nelif a < b print 'b is bigger than a'\nelse print 'they are equals'")
if a > b:
print("a is bigger than b")
elif a < b:
print("b is bigger than a")
else:
print("they are equals")
print("\nNested if.....")
if c > a:
print("c is bigger than a")
if c > b:
print("c is also bigger than b")
else:
print("c isn't bigger than a")
print("\nOperator and & or with one line conditions .....")
print("b isn't the smallest value") if b > a or b > c else print("a is the highest value") if a > b and a > c else ".."