Question: Python Please You are a Database Administrator tasked with creating a database that can be used to keep track of online pizza orders and use

Python Please

Python Please You are a Database Administrator tasked with creating a database

You are a Database Administrator tasked with creating a database that can be used to keep track of online pizza orders and use it to analyze customer order data To accomplish this, you are going to need to do the following: (1) Build the OnlineOrder named tuple with the following attributes: customer_name (string) order_price (float) (2) Write a function named take_order() for OnlineOrder that takes parameters for the customer_name, and order_price, and uses them to create an OnlineOrder named tuple and return the named tuple (3) Write a function named make_db() that takes a list of names, and a list of integers corresponding to the total amount spent for each order. For each pair of values, create an OnlineOrder by calling the take_order() function, and place each order returned into a list. Return the created list. (4) Write a function named mvp(order_db) that takes as input the list of named tuples created using the make_db(function and returns both the name and price of the customer with the highest order price. (5) Print the values returned by mvp(order_db) in main For example, if the input is: 3 D.Va Nerfthis 59.99 Genji Dragonman 39.99 Junk Rat 0.00 Then the output will be: D.Va Nerfthis 59.99 By the way, I've taken all the user input for you so you don't have to wte time on it. You're welcome. main.py Load default template... 1 'FOR CREDIT, YOU MUST COMPLETE THE FOLLOWING INFORMATION 2 YOUR_NAME 3 UCI STUDENT_ID = "###### 4 LAB_SECTION_NUMBER = "#" 5 LAB_SECTION_NUMBER = "" # put down your lab section number (1-8, should match the chapter number of this particular zyLab) 6 LAPTOP_ID = "" # the number on the sticky note attached to your laptop 7 ''FOR CREDIT, YOU MUST COMPLETE THE ABOVE INFORMATION" 8 9 10 from collections import namedtuple 11 12'' Build named tuple here" 13 14 Write Functions Here"! 15 16 if __name__ _main__": 17 names 18 prices = 0 19 num_orders - int(input) 20 for i in range(num_orders): 21 name = input 22 price = float(input) 23 names.append(name) 24 prices.append(price) 25 26 "Call functions and print here IT

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!