Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- all = input("Enter scores seperated by spaces from one line: ")
- all = all.split(" ")
- all_scores = []
- best = 0
- for s in all:
- all_scores.append(int(s))
- if int(s) > best:
- best=int(s)
- for score in all_scores:
- if score >= best-10:
- print(f'Student {all_scores.index(score)} score is {score} and grade is A')
- elif score >= best-20:
- print(f'Student {all_scores.index(score)} score is {score} and grade is B')
- elif score >= best-30:
- print(f'Student {all_scores.index(score)} score is {score} and grade is C')
- elif score >= best-40:
- print(f'Student {all_scores.index(score)} score is {score} and grade is D')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement