Given a dictionary where the keys are student names and the values are their corresponding grades, write a program that takes the name of a student as input and prints out their grade. If the student's name is not found in the dictionary, print 'Not found'.
Operations with dictionary
Find student grade from dictionary
Report a typo
Sample Input 1:
AliceSample Output 1:
85Sample Input 2:
BobSample Output 2:
92Write a program in Python 3
# Dictionary of student grades
student_grades = {
"Alice": 85,
"Bob": 92,
"David": 78,
"Emma": 95
}
# Get student name from user input
student_name = input()
# Check if the student name exists in the dictionary and print their grade
# TODO: Write your code here
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.