Need help, Invalid Syntax

Ge'ez's Avatar, Join Date: Aug 2006
Newbie Member
Sorry if this is the wrong section to post this.

I'm starting to learn Python as my first program and I'm trying to do the exercise at the bottom of this tutorial page (

Here's what I have but I keep getting an error ("There's an error in your program:invalid syntax") when I try to Run>Run Module.

def print_options():
    print "Options:"
    print "'p' print options"
    print "'r' Area of a rectangle"
    print "'s' Area of a square"
    print "'c' Area of a circle"
    print "'q' quit the program"

def rec_area(l,w):
    rarea = l*w
    return rarea
def squ_area(l,w):
    sarea = l*w
def cir_area(r):
    carea = 3.14*r**2

choice = "p"
while choice != "q":
        if choice == "r":
            l = input ("Length:")
            w = input ("Width:")
            print "The area of this rectangle=", rec_area(l,w)
        elif choice == "s":
            l = input ("Length:")
            w = input ("Width:")
            print "The area of this square=", def squ_area (l,w}
        elif choice == "c":
            r = input ("Radius:")
            print "The area of this circle=", def cir_area(r)
        elif choice != "q":
        choice = raw_input("Option:")
TEJUS's Avatar, Join Date: Aug 2006
Go4Expert Member
sorry,i think this is not the right place for u to post such posts.if i have learnt python then surely i
was going to help u .Don't worry ,if u have any doubts in C (not C++) then ask me.