In: Computer Science
categories = {} while True: score = int(input("Enter a score given as integer percentages in the range 0 to 100: ")) if score < 0: break if score >= 90: grade = 'A' elif score >= 80: grade = 'B' elif score >= 80: grade = 'C' elif score >= 80: grade = 'D' else: grade = 'F' if grade not in categories: categories[grade] = 0 categories[grade] += 1 for grade in sorted(categories): print("Number of {} grades is {}".format(grade, categories[grade]))