[Tutor] Why does my code show this?

geon geon at post.cz
Sun Jul 10 22:20:29 CEST 2005


Nathan Pinno napsal(a):

>     cal_opt = int(raw_input("What option would you like: "))
>     if cal_opt == "1":
>            ......
>


your problem is in these two lines (and even more, but if you solve 
this, the others you get for free).
try run just these two lines and guess, think about what kind of 
variable is  in cal_opt.


>     elif cal_opt == "2":
>         X = input("First number:" )
>         Y = input("Second number:" )
>         print X, "-", Y, "= ",X - Y
>         cal_opt = int(raw_input("Option: "))
>
the other trouble might be on the last line - note that "if" is not 
"while". :-)

before creating your own program would be better to go through some nice 
tutorial,  to get some experience.........

nice pytime
geon

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20050710/add7a54d/attachment-0001.htm


More information about the Tutor mailing list