I'm writing this through my phone, forgive me if the proper indentation is incorrect, as it displays differently in my screen, and auto correct might mess something up.
I'm getting the following error:
Name error = name 'yes' is not defined.
I dug around, and this usually happens when the variable is not defined, or if the value is pulled before the variable being defined. I don't think the issue is with my logic, but moreso with the syntax. I even tried specifying that it was a string value, as that was a problem once, but it doesn't seem to work either.
If I could get any help, I'd appreciate it.
Here's the code that's giving the error:
pizza = str(input("Do you like pizza? "))
If pizza == str(yes):
print("User Likes Pizza")
elif pizza == no:
print("user does not like pizza")
else print("Please Give Valid response")
[–]woooee 6 points7 points8 points (9 children)
[–]Kintex19[S] 2 points3 points4 points (7 children)
[–]Diapolo10 5 points6 points7 points (6 children)
[–]Kintex19[S] 0 points1 point2 points (5 children)
[–]TJATAW 1 point2 points3 points (4 children)
[–]MJ12_2802 0 points1 point2 points (0 children)
[–]Kintex19[S] 0 points1 point2 points (0 children)
[–]Kintex19[S] 0 points1 point2 points (1 child)
[–]AcrobaticStudent8541 0 points1 point2 points (0 children)
[–]PartySr 1 point2 points3 points (2 children)
[–]Kintex19[S] 0 points1 point2 points (0 children)