How to create a Receipt Generator in Python Basics



In this post we will make a Receipt Generator using Python with VS CODE 

So we have to create an application which will take input froom user and add it until the user presses the enter key and then display the total price.

 This is a basic application  which ca be used in stores to calculate and generate bills. This application will keep store the numbers user has put and will add them under the user presses "Q" on thier keyboard. Then the application will print the result asa bill.


 sum = 0
while (True):
	userInput = input("Enter the item price or press q to quit: \n")
	if (userInput!='q'):
		sum = sum + int(userInput)
		print(f"Order total so far: {sum}")
	else:
		print(f"Your Bill total is {sum}. Thanks for shopping with us")
		break

Video Output:

Post a Comment

Previous Post Next Post