[Tutor] list with area calculation

Alan Gauld alan.gauld at blueyonder.co.uk
Thu Dec 4 03:51:57 EST 2003


> make it work. I am not surprise if it just some stupid mistake
but I
> can't figure it out.
>
> choice = "p"
> while choice != "q":
>     if choice == "s":
>         width = input("Type width:")
>         print "Area is: ", square(width)
>     elif choice == "r":
> ... code snipped ...
>     elif choice != "q":
>         print_options()
>     choice = raw_input("option: ")

You don't tell us what's going wrong!
My initial thoughts include the fact that the last
elif could just be an else, but otherwise, what is the problem?

Alan G.




More information about the Tutor mailing list