Computer Science, asked by Sudais72462, 10 months ago

rite a Python program to perform the below To input the Student name To input the price of 5 items Find the Total price of items Input the Total Amount. Check, If the Total Amount is less than Total price of items, print “The Amount is lesser", otherwise Calculate the Balance Amount. (Balance Amount = Total Amount - Total price of items). Display the Bill as shown in the below format . AL - Musannah Super Market Bill Student Name: Mohammed Total price of Items: 150 Total Amount: 500 Balance Amount: 350 Thank you Visit again

Answers

Answered by markmadhukar03
0

Answer:

here you go...

note: i am assuming you use python 3.6 or above

Explanation:

name = input('enter your name: ')

prices = list()

for i in range(0, 5):

   price = int(input( f'enter price for item {i + 1}: '))

   prices.append(price)

total_price = sum(prices)

total_amount = int(input('enter total amount: '))

if total_amount < total_price:

   print('The Amount is lesser')    

else:

   balance = total_amount - total_price

   print( f'''

AL - Musannah Super Market Bill

Student Name: {name}

Total price of Items: {total_price}

Total Amount: {total_amount}

Balance Amount: {balance}

Thank you Visit again''')

Similar questions