Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This programs have to be done in Python Exercise 2: Creating two lists for even numbers and odd numbers for numbers from 1 to 40
This programs have to be done in Python
Exercise 2: Creating two lists for even numbers and odd numbers for numbers from 1 to 40 This exercise creates two number lists. One list is for all even numbers from 1 to 40. The other list is for all odd numbers from 1 to 40. Exercise 3: Creating a telephone number dictionary a. This exercise creates a telephone number dictionary for 10 persons. Then (1) print the telephone directory, and (2) access a specific element of the phone dictionary by giving the key (name) of that element. b. Using items() method to retrieve the key and related value Create a phone directory dictionary. Use a for loop to iterate through dictionary elements to print the phone number of each person (eg., The telephone number of Tim is 7342101111) c. Sorting Use list and sorted function to compare the phone directory dictionary keys before and after sorting. Exercise 4. Creating a dictionary of state, capital, and population Create a dictionary of 10 selected states including the data of capital and population. Then use for statement to print the capital and population of each state. Note: Use the format: states = {'Alabama':{'capital':"Montgomery", "population": 4.89}, 'Arizona':{'capital': 'Phoenix', "population":7.17}, 'California':{'capitla': 'Sacramento', 'population': 39.87}, ---- for state, capital in states.items(): print("The capital and population of % = %s" % (state, capital)) Exercise 5: Creating a calculator module Create a calculator module that can perform addition, subtraction, multiplication, division, exponentiation, and logarithms. Exercise 6: Creating a simple statistic module Create a statistic module to calculate the average (mean), median, and standard deviation of any given set of numbersStep 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