Just started, need help!

Kragen Sitaker kragen at pobox.com
Sat Dec 1 18:25:44 EST 2001

"Kyle Thompson" <skunkteeth at focuslost.com> writes:
>   When I do an input command, I hit enter so I may then do the if and else
> command but when I hit enter it try's to run the input command. How do I
> make it not run when its being made and just run when I'm done with a part
> and want to run it?

I think I understand what you're asking, but I'm not sure.  Here's the
answer to what I think you're asking.

Put the stuff you want to not run inside a def, like this:

def hikyle():
    name = raw_input("What's your name? ")
    if name == 'Kyle':
        print "I love you"
    print "hello,", name

Then you can run it by typing hikyle().

More information about the Python-list mailing list