A program to get average scores and credits for Python questions

Asked 2 years ago, Updated 2 years ago, 18 views

Obtain the average score of the two subjects, and write a program to get grades A 80 or higher, 70 or higher C 60 or higher, D or F (variable names are specified as score1, score2)

How do I solve the question?

python

2022-09-20 10:50

1 Answers

score1=int(input('score1:'))
score2=int(input('score2:')
result=(score1+score2)/2
if result>=90:
    print("A")
elif result>=80:
    print("B")
elif result>=70:
    print("C")
elif result>=60:
    print("D")
else:
    print("F")    


2022-09-20 10:50

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.