Hi if someone could help me id be really grateful..
im new to this and just started studying it.. I been asked to write a simple code asking for a number of burgers a pre determined price and to give the total cost of it after.
Ive managed to do this with some messing about and several youtube videos, however I don't really understand something. if I put the code below at first I was * (multiplying) num_burger bhy cost_burger and was getting an error message, however when I reversed it to cost_burger by num_burger it was ok? could someone explain this to me so I don't run into the same problem especially when doing bigger coding.. Many Thanks
This one works...
im new to this and just started studying it.. I been asked to write a simple code asking for a number of burgers a pre determined price and to give the total cost of it after.
Ive managed to do this with some messing about and several youtube videos, however I don't really understand something. if I put the code below at first I was * (multiplying) num_burger bhy cost_burger and was getting an error message, however when I reversed it to cost_burger by num_burger it was ok? could someone explain this to me so I don't run into the same problem especially when doing bigger coding.. Many Thanks
This one works...
num_burgers = input("how many burgers do you want ? ") cost_burgers = 1.55 print("\nok each burgers cost 1.55 each") print("\nso the price of your burger will be £" + str(float((cost_burgers) * (float(num_burgers)))))However this doesn't????
num_burgers = input("how many burgers do you want ? ") cost_burgers = 1.55 print("\nok each burgers cost 1.55 each") print("\nso the price of your burger will be £" + str(float((num_burgers) * (float(cost_burgers)))))Many thanks