Question

PYTHON3 code Each of you will create a cash register / point of sale for your favorite retail establishment (restaurant, stor
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Enter item name : Onions Enter quantity of item : 10 Enter price of item : 1.2 Want to add another item ? (y or n) : Y Enter

code:

def main():

groceries = []

total = 0

#loop through indefinite times untill user says no

ch = 'y'

while ch!='n':

#ask for item name, quantity and it's price

item = []

name = input("\nEnter item name : ")

quantity = int(input("Enter quantity of item : "))

price = float(input("Enter price of item : "))

item.append(name)

item.append(quantity)

item.append(price)

#add item to groceries

groceries.append(item)

#finding total price

total += (quantity*price)

ch = input("\nWant to add another item ? (y or n) : ").lower()

#printing reciept

print("\n\n{:<15}{:<10}{:<10}".format("Item","Quantity","Price"))

for item in groceries:

print("{:<15}{:<10}{:<10}".format(item[0],item[1],item[2]))

print("Total cost of items : ",total)

main()

Add a comment
Know the answer?
Add Answer to:
PYTHON3 code Each of you will create a cash register / point of sale for your...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT