You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'''Write a function that generates ten scores between 60 and 100. Each time a score is generated, your function should display what the grade is for a particular score. Here is the grade table:
2
+
3
+
Score: 60 - 69; Grade - D
4
+
Score: 70 - 79; Grade - C
5
+
Score: 80 - 89; Grade - B
6
+
Score: 90 - 100; Grade - A'''
7
+
importrandom
8
+
deffinal_grade(num):
9
+
grade=""
10
+
foriinrange(num):
11
+
score=random.randint(60,100)
12
+
ifscore>=60andscore<70:
13
+
grade="D"
14
+
elifscore>=70andscore<80:
15
+
grade="C"
16
+
elifscore>=80andscore<90:
17
+
grade="B"
18
+
elifscore>=90:
19
+
grade="A"
20
+
printgrade
21
+
print"Score: "+str(score) +"; Your grade is "+grade
0 commit comments