[Tutor] python

brandon w thisisonlyatest at gmx.com
Sun Aug 14 19:40:39 CEST 2011


On 08/14/2011 09:04 AM, je.rees e-mail wrote:
> I have made a small program but I would like to know how to write or. 
> There is multiple choice answer.
> Good=raw_input("Good to hear")
> ok=raw_input("Good good")
> Bad=raw_input("Oh dear")
> I would only like the person using the program to be able to pick one.
>
> Thanks
>
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>    
Why not writing the program and running it to see what happens?

try something like this:

good = raw_input("Did you have a nice day? ")

if good == "yes":
         print "I'm glad you had a nice day."
else:
         print "Sorry to hear that."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110814/ce46306c/attachment.html>


More information about the Tutor mailing list