Question: Create a python program for the given problem. Problem D: Buffet Admission, Revisited LIST COMPREHENSION A buffet restaurant determines the price of admission based on

Create a python program for the given problem.
Problem D: Buffet Admission, Revisited
LIST COMPREHENSION
A buffet restaurant determines the price of admission based on the height of the guest in
centimeters. Guests that are below 92 centimeters tall are admitted without charge. Guests
who are 92 centimeters to 122 centimeters tall are charged 550 pesos. Guests who are taller
than 122 centimeters up to 152.5 centimeters are charged 750 pesos. Admission for all other
guests are 900 pesos.
Create a function named calculateCost that accepts a list of heights from the user. Your
function should print the total admission cost for the group with an appropriate message. The
total cost should be displayed using two decimal places. It is expected that the user will input
positive numbers.
Your function must only use list comprehensions to calculate the total admission cost; no
loops and no if-elif-else chains are allowed.
End your code with a call to the print function containing two parameters. The first one
should be "PHP". The second one is calculateCost. For its own parameter, calculateCost should
have the input function wrapped inside the eval function.
Create a python program for the given problem.

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 Programming Questions!