logo CodeStepByStep logo

dict_declare_names_ages

Language/Type: Python collections dict

Write the code to declare a dictionary called ages that associates people's names with their ages. Add the following pairs:

  • "Marty" is age 39.
  • "Eve" is age 1.
  • "Nick" is age 17.
  • "Larry" is age 0.
  • "Gina" is age 25.
Bare code: Write a fragment of Python code as described, without any class or function/method heading around your code.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.