Learning Python

Byte eoinrogers at gmail.com
Sun Feb 5 10:52:34 EST 2006


I know this is probably a stupid question, but I'm learning Python, and
am trying to get the if function to work with letters/words. Basicly,
I'm trying to write a script that when run, says

Please enter your name:

Then, if the user types myself as the name , the output is OK. Thats
all I want it to do (remember, Im just new). The code Ive tryed is:


x = input(raw_input("Please enter your name: "))
if x==myself: print 'OK'

It kinda works - I can get to the please enter your name bit but then
it simply reprints your input as output. Someone please HELP!

p.s. Im using Ubuntu Linux 5.10 "Breezy Badger". Dont know if you need
that info, but just in case.




More information about the Python-list mailing list