-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathif_else.py
More file actions
19 lines (14 loc) · 730 Bytes
/
Copy pathif_else.py
File metadata and controls
19 lines (14 loc) · 730 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# when we have to work according to condition then we have to use if else or elif
# a=int(input("enter your age"))
# firstly it will check the if statement if true then jumps out of ifelse if not true then goes to elif statement and if that elif is also wrong then it will move to else
# if(a<18):
# print("you can drive")
# elif(a==18):
# print("agle saal aana")
# else:
# print("you cannot drive") # the space before print is intendation which means we have entered inside else block
# short hand if else statement that is used when the condition is simple and the code block is short and it is not good for complex programs
print (109) if(109>100) else print(100)
a=10
b=100
print(9) if a>b else print("err")