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 (http://www.honors.montana.edu/~jjc/easytut/easytut/node9.html) 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. Code: 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": print_options() choice = raw_input("Option:")
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.