I am trying to make a program that will "guess" your age it really just uses algorithms to get your age anyways I ran into a syntax error and I have checked it many times I still don't know what it is. Please check this and tell me what you think is wrong and put the correct code please. Here is the code.
Num=int(input("Enter a number 1-10: "))
ADD=raw_input("Have you had your birthday this year? Yes or No?: ")
if ADD=='Yes' or ADD=='yes':
if ADD=='No' or ADD=='no':
BY=int(input("What year were you born in? Put in numbers.: ")
Apparently I have a syntax error please help
Post a Reply
|Oldest Newest Rating|
· April 13, 2015
Hello Ian Wheeler,
I found a few things wrong with this code. The first thing I notice right away was that you forgot to place an ending parenthesis on the int, where you declared "BY". The other thing I noticed was, which is not a error, is that when you print "M5" you do not have place the '("")+' next to the M5. I think I was able to fix the error. Why I say 'I think' is because I used Python 2.7, and what you provide does not accomplish what you are seeking. Lastly here is your code that should be fixed.
I hope this works,
P.s. You're the first I have replied to yet.
Bernard Pyc0d333 Parah
· April 13, 2015
This is python2
print ("string") for python 3
· April 9, 2015
If you have an error in python, you need to use code tags. Python is based on indentation. However, in this post, everything is aligned including if statements so it is impossible to give a baisc kind of syntax error.
Additionally, you should specify a python version between 2 and 3. I am assuming Python3 b/c of the print but I could be wrong.
Test it at ideone.com.
· April 10, 2015
I think that you are minxin pyhotn 2 and 3 syntax
This section is all about snakes! Just kidding.
|Bucky Roberts Administrator|