Create a dictionary named tickets

Assignment Help Basic Computer Science
Reference no: EM131483853

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).

Reference no: EM131483853

Questions Cloud

Set up and justify the corresponding primal problem : The textbook discussion of monopsonistic behavior begins with stating the system of inverse input supply functions,Ps = g + Gs, where G is a symmetric positive.
Three primary activities that make up the hiring process : What are the three primary activities that make up the hiring process?
Examine correctional organization-administration functions : Write a research project in which you outline the various processes of jails, prisons, probation, parole, juvenile and community corrections.
Integrating marketing communications : Please read the journal publication, "Integrating Marketing Communications: New Findings, New Lessons, and New Ideas."
Create a dictionary named tickets : 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.
Differences between the tuckman model and the wheelan model : What are the differences between the Tuckman Model and the Wheelan Model?
Set up the symmetric quadratic programming specification : Symmetric quadratic programming (SQP) is suitable for analyzing monopolistic and monopsonistic behavior. Assume that the entrepreneur is a perfectly.
Research the oregon death with dignity law : Research the Oregon "death with dignity" law. What protections does the law provide for persons who wish to commit suicide due to a terminal illness?
How would you ensure your research would be ethically sound : In a hypothetical situation, How would you ensure your research would be ethically sound?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd