#Popcorn Hack 1
sample_dict={}

x = 5
for i in range(x):
    y = input("Enter something:"
    sample_dict[i] = y
    print(y)
#Popcorn Hack 2
nums = []

x = 5
for i in range(5):
    user = int(input("Enter a number"))
    if user % 3 ==0:
        nums.append(user)
    else:
        break
        
print("The only numbers that are divislbe by 3 that you entered are:")
print(nums)
    
The only numbers that are divislbe by 3 that you entered are:
[9, 6, 3]
#Poprocn Hack 3 

numbers = [1, 2, "Bronny AGe 43", 4, 0, "five"]

for item in numbers:
    try:
        print(10 / item)
    except ZeroDivisionError:
        print("Division by zero")
    except TypeError: 
        print("Type error")
10.0
5.0
Type error
2.5
Division by zero
Type error

Homework

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