Write a Python program for the Express (less than 10 items) lane at a supermarket. Use the main function and a value-returning function named subtotal
The main function must prompts for the number of different items in the customer's cart and uses a loop to execute the subtotal function for each item. It must also catch the value returned by subtotal and add it to the total then prints the total after all items have been processed
The subtotal function needs to be defined with no parameters. prompts for the unit price and quantity of each item calculates and prints the subtotal and then returns the subtotal to main
sample
Program Screenshots:


Sample Output:

Code to be Copied:
#define the main function
def main():
#print the header message of program
print("Express checkout. Maximum 10 items")
#set the total value to 0
total=0
#prompt for the number of items
num_items=int(input("How many different items do you have? "))
#if num_items greater than 10
#set the value to Max 10
if(num_items>10):
num_items=10
#use for-loop to repeat until num_items
for i in range(num_items):
#add the total to the subtotal
#by calling the function
total+=subtotal()
#print the total value
print("Total: $",total)
#print the end message
print("Thank you. We appreciate your business")
#define the sub function subtota;()
def subtotal():
#prompt and read the quantity of item
print("Enter quantity of item #",end=" ")
quantity=eval(input())
#prompt and read the unit_price of item
print("Enter unit price of this item: ",end=" ")
unit_price=eval(input())
#compute the subtotal
subtotal = unit_price * quantity
#print the subtotal
print("Sub total: ",subtotal)
#return subtotal to the main function
return subtotal
#call the main method
main()
Write a Python program for the Express (less than 10 items) lane at a supermarket. Use...