Skip to content

Commit 10412f2

Browse files
committed
If Else condition code done
1 parent 40b6311 commit 10412f2

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

IfElse.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
num = int(input())
2+
if (num%2==1):
3+
print("Weird")
4+
else:
5+
if((num>=2) and (num<=5)):
6+
print("Not Weird")
7+
if ((num>=6) and (num<=20)):
8+
print("Weird")
9+
if (num>20):
10+
print("Not Weird")
11+
12+
"""
13+
In python there are no {} blocks of code.
14+
Here Indentation is a must
15+
All looping and conditions must be followed by :
16+
&& is not present like C C++ and Java and keyword is used here
17+
elif is used not else if
18+
"""

0 commit comments

Comments
 (0)