Hello, when my application run, I want when I write 'a' and click enter, it do an action. But when I write 'b' and click enter, it do another action.
Thanks for anyhelp.
Hello, when my application run, I want when I write 'a' and click enter, it do an action. But when I write 'b' and click enter, it do another action.
Thanks for anyhelp.
That's a simple matter of input using raw_input().
[code=python]
letter = raw_input("Ente r a letter: ")
if letter == 'a':
# do one action
elif letter == 'b':
# do another action
[/code]
Is that what you need, or is there more to it?
Hello, when my application run, I want when I write 'a' and click enter, it do an action. But when I write 'b' and click enter, it do another action.
Thanks for anyhelp.
[CODE=python]usersChoice = raw_input("Ente r your choice (a or b): ")
if usersChoice == 'a':
print "doing choice 'a'."
elif usersChoice == 'b':
print "doing choice 'b'."
else:
print "You've made a bad choice."
[/CODE]
Comment