-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathif_else.py
More file actions
42 lines (35 loc) · 1012 Bytes
/
Copy pathif_else.py
File metadata and controls
42 lines (35 loc) · 1012 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
# if-else statement
a=int(input("enter your age: "))
print("the age is", a)
if(a>18):
print("you can drive the car")
else:
print("you can not drive the car")
print("woooo")
# elif statement
number=int(input("enter the number here: "))
if(number>0):
print("the number is positive")
elif(number==0):
print("the number is zero")
elif(number==999):
print("you are the special")
else:
print("the number is negative")
print("woooo")
# nested if statement
marks=int(input("enter the marks here: "))
if( marks<33):
print("the student is fail with F grade")
elif(marks>33 and marks<50):
print("the student grade is E")
if(marks>50 and marks<60):
print("the student grade is D")
elif(marks>60 and marks<90):
print("the student pass with the good marks")
else:
print("the student are the toppers and marks are above 90")
else:
print("the marks is in negative")
print("if fail try hard")
print("if pass congratulation")