Values function to access the values in tickets

Assignment Help Basic Computer Science
Reference no: EM131480397

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: EM131480397

Questions Cloud

Drawbacks from performing data normalization : 1. Compare and contrast 2 benefits and 2 drawbacks from performing data normalization.
How would you find out if error variance is heteroscedastic : In the various wage determination models discussed in this chapter, how would you find out if the error variance is hetero scedastic?
Pace of development for four major operating systems : Compare and contrast the pace of development for four major operating systems.
Definition of core competencies : B222B –Managing Technologies and Innovation - Give a proper definition of "core competencies" and discuss how essential it is for a manufacturing company
Values function to access the values in tickets : Use the keys function to access the keys in tickets_sold_dict. Use a loop to print out the keys.
Find white hetero scedasticity-corrected standard errors : In the chapter on hetero scedasticity we discussed robust standard errors or White hetero scedasticity-corrected standard errors. For the wage determination.
Purpose of conducting a risk analysis : What is the purpose of conducting a Risk Analysis, what does it provide?
Discuss the wage determination model : What other variables do you think should be included in the wage determination model? How would that change the models discussed in the text?
Bios-cmos manage hardware : In a few sentences, discuss how you may have to adjust the BIOS settings when you install them. Based on your learning this week, how does the BIOS/CMOS manage.

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