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

  Write a program using a beginner c language

Write a program using a beginner C language which calculates the value of ? from the series ?=(4/1)-(4/3)+(4/5)-(4/7)+(4/9)-(4/11)+... Print a table that shows the value of ?

  Expressions to a minimum sop or pos

Simplify each of the subsequent expressions to a minimum SOP or POS and sketch the circuit using AND, OR, and NOT gates.

  Social media information systems for business success

For the former, what are they doing well to leverage the social media information systems for business success?

  Write a c program to generate a sine waveform

Divide one period of the sine wave into 60 points and use these 60 points to represent the waveform. Every two adjacent points are separated by 3.0°.

  Result of converting the int value

Write an expression whose value is the result of converting the int value associated with x to a str. So if 582 was the int associated with x you would be converting it to the str"582"?

  List and describe the major pc and server operating systems

Define and describe cloud computing software services, mashups, and apps and explain how they benefit individuals and businesses.

  What created our need for such huge amounts of storage

What created our need for such huge amounts of storage? How have our storage habits changed? What is the perfect balance for you in how you use nonvolatile storage?

  Discuss the reasons why you need to use them

Professionals working in software industry often refer "software design" as "building the bridge between user requirements and the software code".

  Write a cosine function that models the movement of the leaf

Write a cosine function that models the movement of the leaf in relationship to the equilibrium point.

  Construct indicator variables for categorical variable class

When using indicator variables, explain the meaning and interpretation of the indicator variable coefficients, graphically and numerically.

  Create logic circuit which will decode dtmf-like keypad

Create the logic circuit which will decode the DTMF-like keypad. The keypad comprises of 16 keys, numbered 0 to 9, *, #, A, B, C, and D.

  Problem regarding the positive reinforcements

What attributes do positive reinforcements need to have to motivate behavior?

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