Python Forum

Full Version: Code does not complete
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
x = int(input("Enter the number of apples: "))
c = input("what do you want to do with the apple?: ")
if x == 1:
    print("got it")
elif x == 2:
    print("got it")
if c == "store it"
    print("apple is stored")
My issue is when i run the code, it completes the final if statement if c == "store it" but only if I enter a maximum of 2. If I enter 3+, it will not complete that last if statement. Can someone guide me in the right direction?

the actual code is much longer but the same idea. I was thinking maybe the code is too long and by the time it reaches that last if statement it forgets what c was equal to?
if c == "store it" is missing a : from the end.
The result of input value stored in x has no influence over the if c == "store it": statement.
It doesn't matter how long the code is , it will not forget the value of c.