PDA

View Full Version : Python "Invalid Syntax" error message on coln


benigmo
Oct 19, 2015, 07:34 AM
Okay, so I'm VERY new Python(I believe I'm using 3.4.2) I'm still experimenting and self-learning. I wrote a script, but it gives me an "Invalid Syntax" error on a colon every time. I'm not really sure why. It's also probably tru that I am just doing this entire thing completely incorrectly, so if you could just answer this question, it would help me a lot. Also, I tried getting rid of the colon(which I didn't think was the problem, anyway) but then on the next line, it just gave an "Unexpected Indent"error message. Here is the script I have:


input(number): #<--- Syntax error here
if type(number) == int or type(number) == float:
return abs(number)
elif len(number) > 9:
return “Figure too long!”
else:
return “Invalid figure!”


print (return)
Invalid syntax