You have been hired as an app developer for the company. The company plans to make an app for a grocery store where the user can order groceries and see the total amount to be paid in the cart section. To build this feature, you have to write a function that takes 2 arguments. They are: • order_items (must be a list) • location (default value should be set to "Dhanmondi") Your first task is to take a list of items from the user. Pass the list into the function parameter along with the optional location (Use default argument technique). (Also, no need to take location as input, pass this any value you want.) Your second task is to implement the function. In the function, create a dictionary for the items shown in the table. Calculate the total price of the items passed as a list to the function. Additionally, add a delivery fee of 30 taka if the location is Dhanmondi. Otherwise, add a delivery fee of 70 taka. Finally, return the value and print it.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Must show it in Python:

Please show step by step with comments.

Please show it in simplest form.

Input and Output must match with the Question

Please go through the Question very carefully.

Example1:
function_name(["Rice", "Beef", "Rice"], "Mohakhali")
total = 105 + 510 + 105 = 720 (Take the price of each item and add them.)
total = 720 + 70 = 790 (Finally, add the delivery fee based on the location.)
Input:
["Rice", "Beef", "Rice"]
Function Call:
function_name(["Rice", "Beef", "Rice"], "Mohakhali")
Output:
790
Example2:
function_name([("Rice", "Beef", "Rice"])
total = 105 + 510 + 105 = 720 (Take the price of each item and add them.)
total = 720 + 30 = 750 (Since no location is passed in the parameter, it will use the default location-"Dhanmondi". For dhanmondi, delivery fee of 30 taka)
Input:
["Rice", "Beef", "Rice"]
Function Call:
function_name(["Rice", "Beef", "Rice")
Output:
750
Transcribed Image Text:Example1: function_name(["Rice", "Beef", "Rice"], "Mohakhali") total = 105 + 510 + 105 = 720 (Take the price of each item and add them.) total = 720 + 70 = 790 (Finally, add the delivery fee based on the location.) Input: ["Rice", "Beef", "Rice"] Function Call: function_name(["Rice", "Beef", "Rice"], "Mohakhali") Output: 790 Example2: function_name([("Rice", "Beef", "Rice"]) total = 105 + 510 + 105 = 720 (Take the price of each item and add them.) total = 720 + 30 = 750 (Since no location is passed in the parameter, it will use the default location-"Dhanmondi". For dhanmondi, delivery fee of 30 taka) Input: ["Rice", "Beef", "Rice"] Function Call: function_name(["Rice", "Beef", "Rice") Output: 750
Task 15
You have been hired as an app developer for the company. The company plans to make an app for a grocery store where the user can order groceries and
see the total amount to be paid in the cart section.
To build this feature, you have to write a function that takes 2 arguments. They are:
• order_items (must be a list)
• location (default value should be set to "Dhanmondi")
Your first task is to take a list of items from the user. Pass the list into the function parameter along with the optional location (Use default argument
technique). (Also, no need to take location as input, pass this any value you want.)
Your second task is to implement the function. In the function, create a dictionary for the items shown in the table. Calculate the total price of the items
passed as a list to the function. Additionally, add a delivery fee of 30 taka if the location is Dhanmondi. Otherwise, add a delivery fee of 70 taka. Finally,
return the value and print it.
Item Price(Tk)
Rice
105
Potato
20
Chicken
250
Beef
510
Oil
85
====== =====
====
Hint: The keys are the items and values are the corresponding price. Iterate the items in the list and check if the items in the list are available in the
dictionary keys or not. If it is available, add the price.
====E
======
Transcribed Image Text:Task 15 You have been hired as an app developer for the company. The company plans to make an app for a grocery store where the user can order groceries and see the total amount to be paid in the cart section. To build this feature, you have to write a function that takes 2 arguments. They are: • order_items (must be a list) • location (default value should be set to "Dhanmondi") Your first task is to take a list of items from the user. Pass the list into the function parameter along with the optional location (Use default argument technique). (Also, no need to take location as input, pass this any value you want.) Your second task is to implement the function. In the function, create a dictionary for the items shown in the table. Calculate the total price of the items passed as a list to the function. Additionally, add a delivery fee of 30 taka if the location is Dhanmondi. Otherwise, add a delivery fee of 70 taka. Finally, return the value and print it. Item Price(Tk) Rice 105 Potato 20 Chicken 250 Beef 510 Oil 85 ====== ===== ==== Hint: The keys are the items and values are the corresponding price. Iterate the items in the list and check if the items in the list are available in the dictionary keys or not. If it is available, add the price. ====E ======
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY