Write a shopping system procedures, using the cycle to achieve infinite shopping
1. Include a welcome
Print (” welcome to the shop “) sum = 0 # while True: # 2 Print (” Please select the product you want to buy “) print(“1.T shirt 2. Number = input(” Please input the number of the product you want to buy “) # 4. # 1==”1″ if number ==”1″ : print(” you bought T shirt, 250 yuan “) sum = sum+250 elif number ==” 2″: Sum = sum+ 300 elif number == “3”: print(” you bought a down jacket, 350 “) sum = sum+350 else: Print (” roll “) char = input(” input n”) if char == “n”: break
5. Output the total price of this purchase
Whether numeric type can be converted to character type
Print (” + STR (sum) “)