python - How can I remove a variable that contains a string? -


This is my program that I am writing for a school project. In the previous other functions, you can see that I am trying to delete the previous pizza order because the user has made a typo, however, provides a simple - = one type error: - =: 'str' and 'str The unsupported opaque type (s) provides for it is writing anything except my first scratch (: P) so that a help would be appreciated. "BBQ chicken and bacon \ n", "apricot chicken \ n \", "super sweeten \ n", "meat lover \ n", "BBQ chicken and bacon \ adjacent chicken \ n "," pepperoni Feast \ n ", \" Beef Italiano \ n "," seafood deluxe \ n "" BBQ Hawaiian \ n ", \" pepperoni lover \ n \ "," wedge Supreme \ n ", "Thieves of cheese \ n", "Beef Hot \ Spicy \ n", "Roma \ n", "Hawaiian \ N", "Vegetarian Cheese \ n", "Vegan Hot" Spicy \ n "," We and Paneer \ N "," beef and onion \ n ", \" margarita \ n "," large fries \ n "," garlic bread \ n ", "Onion rings \ n", \ "5 Spicy Chicken Wings", "dipping sauce", "Orange Juice \ n", \ "Bottled water \ n", "355ml soft drinks (", "1.5L soft drinks (" ]; Aitm_pris = [0,10.50,10.50,10.50,10.50,10.50,10.50,10.50,10.50,8.00,8.00, \ 8.00,8.00,8.00,8.00,5.00,5.00,5.00, 5.00,5.00,5.00,3, 50,3.50, \ 3.50,5.00,0.50,3.50,3.50,1.90,3.90]; print ( "Hello and welcome to Sinanigan Pijhghri!") begins when = 1 start == 1: menu_prompt = str ( Input ("Do you want to open menu? Y / n \ n") if menu_property == "y": start = 0 menu () running_total = 0 running_names = '' loop1 = 1 while loop1 == 1: dictionary Training in: items_number = int (input ( "Please number of desired items \ n")) running_total + = float ((item_prices [items_number])) run_names + = item_names [items_number] query1 = str (input ( "Is it all ? Y / n \ n \ n ")) except IndexError: Print (" Please enter a valid item number. \ N \ n ") if query1 ==" y ": loop1 = 0 print (current_name) print (" total "Running:", "$", (current_kas)) print ("Thank you for visiting \ N! Your order is being!") Elif query1 == "n": Print (current_name) Print ("Running total:" , "$", (running_total)) else: running_total - = float (item_prices [items_number])) Running_names - = item_names [items_number] print ( "Please enter a '' y 'or' n '" Ant) Elif Menu_prompt == "N": Print ("OK. Thank you for coming. Next time.")

Use str.replace to change the string An empty string:

  running_names = running_names. [7] in the replace (item_names [items_number], ""): running_names = "Hawaiian \ nfault \ n": print ( 

you can not reduce the two strings .


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -