If statement with 2 conditions
Hi everyone, i am new to python and came across the problem while programming today and it doesn't makes no sense to me. Could someone please explain why it doesn't work when it basically says the same thing ?
The code that does not work :
if size == "S" and add_pepperoni == "Y":
bill += 2
else:
bill += 3
but when i use it as two separate condition it does work,
if add_pepperoni == "Y":
if size == "S":
bill += 2
else:
bill += 3
Appreciate all the responses.
Posted Oct 7, 2023, 6:12 PM UTC
15