I am learning the python crash course book and really enjoying it. But on the if statements section where i have to write pizza toppings thongs are not working well.
I wondered if i am doing it wrong or something. I am using python 3
here is the code from the book
and if i add the mushroom after the extra cheese then it adds the mushroom and leaves out extra cheese.
Is this common things are am i doing something wrong.
I wondered if i am doing it wrong or something. I am using python 3
here is the code from the book
requested_toppings = ['mushrooms', 'green peppers', 'extra cheese'] for requested_topping in requested_toppings: if requested_topping == 'green peppers': print('Sorry we are out of green peppers right now.') else: print('Adding ' + requested_topping + '.') print('\nFinished making your pizza!')in the book, it says it should come out like this
Output:adding mushrooms
sorry, we are out of green peppers right now.
adding extra cheese
but for some reason, it misses out the adding mushroom bit.and if i add the mushroom after the extra cheese then it adds the mushroom and leaves out extra cheese.
Is this common things are am i doing something wrong.