Skip to content

Commit e694b7f

Browse files
changes
1 parent feec299 commit e694b7f

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

conditions/if_conditions.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
num = 10
22
# simple condition
3-
if num > 2:
3+
if (num > 11 and num > 5) or num > 5 :
44
print("number is greater than 2")
55

6+
7+
8+
print("JVFKVJ")
9+
else:
10+
print("else block")
11+
if num > 5:
12+
print("greater than 5")
613
# even condition
714
if num % 2 == 0:
815
print(num,"number is even")

conditions/ternary_if_condition.py

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
print(num,"Even") if num % 2 == 0 else print(num,"odd")
88

9+
value = "Even" if num % 2 == 0 else "odd"
10+
print(value)
11+
912
num = 13
1013

1114
print(num,"Even") if num % 2 == 0 else print(num,"odd")

0 commit comments

Comments
 (0)