Advertisement
biswasrohit20

score

Mar 23rd, 2021
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. all = input("Enter scores seperated by spaces from one line: ")
  2. all = all.split(" ")
  3. all_scores = []
  4. best = 0
  5. for s in all:
  6. all_scores.append(int(s))
  7. if int(s) > best:
  8. best=int(s)
  9. for score in all_scores:
  10. if score >= best-10:
  11. print(f'Student {all_scores.index(score)} score is {score} and grade is A')
  12. elif score >= best-20:
  13. print(f'Student {all_scores.index(score)} score is {score} and grade is B')
  14. elif score >= best-30:
  15. print(f'Student {all_scores.index(score)} score is {score} and grade is C')
  16. elif score >= best-40:
  17. print(f'Student {all_scores.index(score)} score is {score} and grade is D')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement