Python simple price calculator
I have made a simple price calculator using python and in my previous blog I have made same calculator using c++ ;
It's a basic and very simple program it will ask the product name and its price and at the end it will return the total price.
To stop the program need to enter the product name as "end" and price as "0" then you will exit the program.
Total number of lines = 10 only......
print("Welcome to the price calculator program:")
sum = 0
while True:
productname = input("Enter the name of the product\n")
price = int(input("it's price: "))
sum += price
if productname == 'end':
print(f"The total price is:- {sum} \n Thank you for using our calculator")
break
0 Comments