plz help with this program

Wenn du dir nicht sicher bist, in welchem der anderen Foren du die Frage stellen sollst, dann bist du hier im Forum für allgemeine Fragen sicher richtig.
Antworten
i'm lost

Code: Alles auswählen

def print_options():
    print "options:"
    print "'p' print options"
    print "'s'Area of a Square"
    print "'r'Area of a Rectangle"
    print "'c'Area of a Circle"
    print "'q'Exit the program"
    
def Square(s_area):
    return (Length*2)

def Rectangle(r_area):
    return (Length*Width)
            
def Circle(c_area):
    return (3.14 * Radius**2)

choice ="p"
while choice!="q":
    if choice=="s":
        area =input("Length:")
        print "Area:",Square (area)
    elif choice=="r":
        area=input("Length:")
        area=input("Width:")
        print "Area:",Rectangle(area)                                
    elif choice =="c":
        area=input("Radius")
        print "Area:",Circle(area)
    elif choice !="q":
        print_options()
    choice = raw_input("option:")




Benutzeravatar
jens
Python-Forum Veteran
Beiträge: 8502
Registriert: Dienstag 10. August 2004, 09:40
Wohnort: duisburg
Kontaktdaten:

Antworten