Create a dictionary and access its values:

SOLUTION.

# Creating a dynamic dictionary with user input
student = {
    "name": input("Enter student's name: "),
    "age": int(input("Enter student's age: ")),
    "grade": input("Enter student's grade: ")
}

# Accessing values dynamically
print("The student's name is:", student["name"])
print("The student's grade is:", student["grade"])

Leave a Reply

Your email address will not be published. Required fields are marked *

sign up!

We’ll send you the hottest deals straight to your inbox so you’re always in on the best-kept software secrets.