Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3 Suppose you have a list of names in the format , and a corresponding list of ages. Write a program that converts these two

3

image text in transcribed
Suppose you have a list of names in the format , and a corresponding list of ages. Write a program that converts these two lists into a single dictionary for which the names are the keys, and the ages the values. Do this by writing a function that accepts the two lists as inputs and returns the dictionary as output. The default input values are empty lists. Then have your main program call the function with the following two lists: ["Sweigart, Al", "Domer, Ima", "Munsch, Charlie", "Wade, Jess"] [32, 18, 71, 45] and print the dictionary item as shown in the following example run: Dictionary key Sweigart, Al has value 32. Dictionary key Domer, Ima has value 18. Dictionary key Munsch, Charlie has value 71. Dictionary key Wade, Jess has value 45. program that matches the printout above. The

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions