Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

USE PYTHON 3 ONLY

1. Create a dictionary named tickets_sold_dict.

2. Write a loop which prompts the user to input the following keys and values and store them in tickets_sold_dict.  Continue to read in the items while exit is not entered.  Be sure to convert the number of tickets sold to an integer.

Smart Figures    1096

Guardians of the Universe 2400

Rogue Eight 958

exit

3. Use the keys function to access the keys in tickets_sold_dict.  Use a loop to print out the keys.

4. Use the values function to access the values in tickets_sold_dict.  Use a loop to print out the values.

5. Compute the sum of all of the values for the tickets sold.  Print out the sum.

6. Create a dictionary named movie_tickets_dict and assign these values for the number of tickets sold.

Early Bird 511

Matinee 343

Evening 942

7. Write a loop which allows the user to enter a key to search for in the movie_tickets_dict, if the key is in the dictionary, print out the number of tickets sold.  If not print the the search key and " was not found".

8.  Write a function named total_sales_function that takes  four parameters: a dictionary, the price of an early bird  ticket, the price of a matinee ticket, and the price of an  evening ticket.  Create a dictionary tickets_dict.  Use a  loop to multiply the price of each type of ticket by the  number of tickets sold.  Store the key and the result of  the calculation in the tickets_dict.  Return the tickets_dict.

9. Call the function from within main with the following arguments: movie_tickets_sold_dict, 4.00, 5.50, and 6.25.  Assign the returned dictionary to tickets_cost_dict.  Print out the keys and values with two decimal places of precision for each item of the returned dictionary tickets_cost_dict.

10. Create a dictionary named sense_hat_dict.  Store the following keys and access the values from the Sense Hat.

  • temperature
  • pressure
  • humidity
  • position: pitch,roll, and yaw dictionary object
  • acceleration: x, y, and z dictionary object

11. Print out the keys and values for each item.  Use the is-instance to determine if the value is a float (flt) or a dictionary (dict).

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92289134
  • Price:- $30

Priced at Now at $30, Verified Solution

Have any Question?


Related Questions in Computer Engineering

What are your thoughts on grant writing and grant money

What are your thoughts on grant writing and grant money toward purchase? How essential is this practice when looking at gaining money toward purchases?

Question suppose two matlab functions find-nonzero and

Question : Suppose, two Matlab functions find-nonzero and row-echelon are available to use. The first function takes a vector as input and returns the location of the first nonzero entry of the input vector. The second f ...

Really needing some help with this assignmentto convert

Really needing some help with this assignment. To convert degrees Celsius to degrees Kelvin, we simply add 273 (°K= °C + 273). Prompt the user for a temperature in degrees Celsius, then convert that temperature to degree ...

In sql developerd1 create the following three user-defined

IN SQL DEVELOPER D1. Create the following three user-defined roles that are shown in the table below and assign them the specified permissions for the OE.CUSTOMERS table. Role Select Insert Update Delete account_managers ...

The average cell phone bill is 78 with a standard deviation

The average cell phone bill is 78 with a standard deviation of 10. What is the minimum percentage of cell phone bills that will be between 54 and 102?

Calculate the probability of selecting a random sample of

Calculate the probability of selecting a random sample of 225 observations with a sample proportion of 0.54 or greater, if the sample population has a population proportion of 0.50.

Question when a syscall is called which register must have

Question : When a syscall is called which register must have the syscall number? Which syscall is a must for every program? Why?

Case study 1 requirement analysis and gathering for the

Case Study 1: Requirement Analysis and Gathering for the State Firefighters Association Read the mini case on The State Firefighters Association located in Chapter 3 of the textbook and complete the assignment. Write a t ...

Suppose our task is to distinguish between humans and

Suppose our task is to distinguish between humans and non-human objects in an image, which classifier would you choose and why? Decision trees, perceptrons or neural nets.

What would be examples of valid selection methods used by

What would be examples of valid selection methods used by the human resource department to ensure selecting the appropriate candidate for a job.

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As