The only numbers that are divislbe by 3 that you entered are:
[9, 6, 3]
10.0
5.0
Type error
2.5
Division by zero
Type error
student_data = {}
students_passed = []
user = int(input("Enter the number of students you would like to add: "))
for _ in range(user):
student_name = input("Enter the student's name: ")
while True:
try:
student_score = int(input("Enter the student's score: "))
break
except ValueError:
print("Please enter a valid integer for the score.")
student_data[student_name] = student_score
highest_score = max(student_data.values())
print("\nStudent Data:")
for student, score in student_data.items():
print(f"{student}: {score}")
print("\nStudents who passed with the highest score:")
for student, score in student_data.items():
if score == highest_score:
students_passed.append(student)
for student in students_passed:
print(student)
print("\nStudents' grades:")
grade_mapping = {90: "A", 80: "B", 70: "C", 60: "D"}
for student, score in student_data.items():
if score >= 90:
grade = "A"
elif score >= 80:
grade = "B"
elif score >= 70:
grade = "C"
elif score >= 60:
grade = "D"
else:
grade = "F"
print(f"{student}: {grade}")
Student Data:
Vance: 99
Ronit: 85
Jared: 67
Students who passed with the highest score:
Vance
Students' grades:
Vance: A
Ronit: B
Jared: D