I'm just starting out with Python, and for some reason I am getting a syntax error. This only happens when I run the whole program at once, but if I run only this little bit, it works fine.

while choice != "q":
    choice = raw_input("What would you like to find the area of?"
    if choice == "s":
        l = input("Length of one side: ")
        print "The area of this square is", square(l)

Just a simple area calculator from an online tutorial. When I run the entire program it says that the : after the "s" is a syntax error. If I remove the : says the "l" before the input is a syntax error. I can post the whole program if necessary.

Edited by happygeek: fixed formatting

10 Years
Discussion Span
Last Post by Thradok
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.