Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Computers for Beginners (https://www.askmehelpdesk.com/forumdisplay.php?f=79)
-   -   Python "Invalid Syntax" error message on coln (https://www.askmehelpdesk.com/showthread.php?t=817220)

  • Oct 19, 2015, 07:34 AM
    benigmo
    Python "Invalid Syntax" error message on coln
    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

  • All times are GMT -7. The time now is 06:20 PM.