Tuesday, June 26, 2018

If statement for strings in python?

I am a total beginner and have been looking at http://en.wikibooks.org/wiki/Python_Programming/Conditional_Statements but I can not understand the problem here. It is pretty simple, if the user enters y it should print this will do the calculation although I get a syntax error on IF answer=="y"



answer = str(input("Is the information correct? Enter Y for yes or N for no"))

proceed="y" or "Y"
If answer==proceed:
print("this will do the calculation"):
else:
exit()

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...