je.rees e-mail wrote:
I would like this script to only have a choice of one these. I'm not sure
how to do it. My example would be when someone types Good next to print how
I want it to reply Thats nice. Anyone know how and if I am making more
mistakes point them out please.


Consider this example:


def test():
    prompt = "Please type 'Thats nice'"
    answer = raw_input(prompt)
    if answer == "Thats nice":
        print "You have typed it accurately"
    else:
        print "I'm sorry, you have made a mistake"


Paste that into the interactive interpreter, then run:

test()


and follow the instructions. Does that help?



--
Steven
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to