Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Databases And Python Programming MySQL MongoDB OOP And Tkinter

Authors: R. PANNEERSELVAM

1st Edition

9357011331, 978-9357011334

More Books

Students also viewed these Databases questions

Question

give examples of technical writing in the workplace?

Answered: 1 week ago