-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExercises 3.py
More file actions
53 lines (46 loc) · 1.31 KB
/
Copy pathExercises 3.py
File metadata and controls
53 lines (46 loc) · 1.31 KB
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
43
44
45
46
47
48
49
50
51
52
53
# phase 1
zander = float(input("Please give the length of zander in centimeters"))
min_l = 42
if zander >= 42:
print("OK")
if zander < 42:
print(f"Release the zander back into the lack, because zander shor by {42-zander}")
# phase 2
answer = input("Enter the cabin class of a cruise ship:")
if answer == "LUX":
print("Upper-deck cabin with a balcony.")
elif answer == "A":
print("Above the car deck, equipped with a window.")
elif answer == "B":
print("Windowless cabin above the car deck.")
elif answer == "C":
print("Windowless cabin below the car deck.")
else:
print("Invalid cabin class")
#phase 3
gender = ("Male", "Female")
q1 = input("What is your biological gender ?")
if q1 == "Male":
q2 = int(input("What is your hemoglobin value (g/l)"))
if q2 > 167:
print("High")
elif q2 < 134:
print("Low")
else:
print("Normal")
elif q1 == "Female":
q2 = int(input("What is your hemoglobin value (g/l)"))
if q2 > 155:
print("High")
elif q2 < 117:
print("Low")
else:
print("Normal")
#phase 4
year = int(input("Enter a Year"))
if (year % 4 == 0) and (year % 100 != 0):
print("This is leap year")
elif (year % 400 == 0) and (year % 100 == 0):
print("This is a leap year")
else:
print("This is not a leap year")