-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconditional.py
More file actions
41 lines (34 loc) · 962 Bytes
/
Copy pathconditional.py
File metadata and controls
41 lines (34 loc) · 962 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
height = int(input('Enter height in feet'))
if height > 3 :
print('Height is greater than 3')
else :
print('Height is less than 3')
# ----------------------------------------
# nested if
a = 52
if a > 2 :
print('even number ')
if a > 10 :
print('Number is both even and greater than 10')
# -----------------------------------------
# else and if
height = int(input('Enter your height in feet'))
if height > 3 :
print('You can go for rollercoaster')
age = int(input('enter your age'))
if age <=18 :
print('Please pay Rs.250')
else :
print('Please pay Rs. 500')
else :
print('Sorry you cant ride')
print('bye')
# -------------------------------------------
mark = float(input('Enter your mark'))
if mark > 90 :
print('Your outstanding')
elif (mark >5 and mark < 90) :
print('Average')
else :
print('failed')
# -------------------------------------------