-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMachorroLab4Grading.py
More file actions
86 lines (84 loc) · 2.3 KB
/
MachorroLab4Grading.py
File metadata and controls
86 lines (84 loc) · 2.3 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#Gary Machorro
#8/8/17
#Lab4 Report Grades
valid = False
count=0
while not valid and count<3:
count+=1
score=int(input("Enter a score:"))
if score >= 0 and score <=100:
valid=True
if score>=0 and score<=59:
print("F")
print("Thank you for using this program!")
elif score>=60 and score<=69:
print("D")
print("Thank you for using this program!")
elif score>=70 and score<=79:
print("C")
print("Thank you for using this program!")
elif score>=80 and score<=89:
print("B")
print("Thank you for using this program!")
elif score>=90 and score<=100:
print("A")
print("Thank you for using this program!")
else:
print("Invalid input, try again")
if count==3:
print("program will close")
#OUTPUT
'''
>>> ================================ RESTART ================================
>>>
Enter a score:122
Invalid input, try again
Enter a score:1000
Invalid input, try again
Enter a score:132
Invalid input, try again
program will close
>>> ================================ RESTART ================================
>>>
Enter a score:-1
Invalid input, try again
Enter a score:0
F
Thank you for using this program!
>>> ================================ RESTART ================================
>>>
Enter a score:50
F
Thank you for using this program!
>>> ================================ RESTART ================================
>>>
Enter a score:60
D
Thank you for using this program!
>>> ================================ RESTART ================================
>>>
Enter a score:69
D
Thank you for using this program!
>>> ================================ RESTART ================================
>>>
Enter a score:70
C
Thank you for using this program!
>>> ================================ RESTART ================================
>>>
Enter a score:80
B
Thank you for using this program!
>>> ================================ RESTART ================================
>>>
Enter a score:90
A
Thank you for using this program!
>>> ================================ RESTART ================================
>>>
Enter a score:100
A
Thank you for using this program!
>>>
'''