Question
using python: Collections: Lists, Tuples, Dictionaries, List Comprehension 1)Dictionaries : Suppose a dictionary has been defined that maps ids to a list of items as
using python:
Collections: Lists, Tuples, Dictionaries, List Comprehension
1)Dictionaries: Suppose a dictionary has been defined that maps ids to a list of items as shown: { id: [phone, [lastName, firstName]] } Ex: myDict={ A1:[701-234-1122, [Brown, Bill] ], B2:[218-477-2339,[Jones,Jennifer] }
Check to see if Smith is in the dictionary and print their firstName, lastName, and phone
Print the first and last names of everyone whose phone# begins with area code 218
Delete the entry with key B2 from the dictionary
2)Write Python code that allows the user to continue entering numbers until they type DONE. Print the average of the numbers, the count of even numbers, and the count of odd numbers entered by the user. Example: if the user enters 1, 10, 15, 20, 25, and finally DONE, the output should be Average: 14.2 Count of evens: 2 Count of odds: 3
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started