-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPython_practice_ifs.py
More file actions
39 lines (35 loc) · 931 Bytes
/
Python_practice_ifs.py
File metadata and controls
39 lines (35 loc) · 931 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
temperature = int(input("What is the temperature outside?"))
if temperature > 80:
print("Turn on the AC.")
else:
print("Open the windows.")
#What is the score?
score = int(input("What is your test score?"))
#Determine the grade.
if score >= 90:
print('Your grade is an A.')
else:
if score >= 80:
print('Your grade is a B.')
else:
if score >= 70:
print('Your grade is a C.')
else:
if score >= 60:
print('Your grade is a D.')
else:
print('Your grade is an F')
#Using if-elif-else statements
#What is the score?
score = int(input("What is your test score?"))
#Determine the grade.
if score >= 90:
print('Your grade is an A.')
elif score >= 80:
print('Your grade is a B.')
elif score >= 70:
print('Your grade is a C.')
elif score >= 60:
print('Your grade is a D.')
else:
print('Your grade is an F.')