View Single Post
Old Nov 19th, 2007, 2:11 AM   #17
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,840
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
Re: Need help with python

Quote:
Damn it, now I'm determined to learn this stuff. Not just to pass this course, but honestly, it's pissing me off because there is nothing I ever quit on. If I get stuck with something, I'll usually end up mastering it, but for some reason this programming has been a definite challenge.
Thank heavens. That's the damn right attitude!



And I believe we've found your problem!

You greatly misunderstood what "raw_input" does.

my_string = raw_input("Enter A String:Billy")

Have you tried running this on its own?

What "raw_input" does, is it shows some text to the user. And then prompts him/her to enter something back!

The text that is shown to the user is whatever you've enclosed in the brackets. In your case, "Enter A String:Billy".

Therefore... when you run that program, the user will see:

Enter A String:Billy

The user will type something in, and "my_string" will equal whatever the person running the program typed in.

Try running this:
x = raw_input("How are you today? ")
y = raw_input("What's your favourite kind of salad? ")

print x
print y

It will prompt you for something twice. Type something in each time and hit enter. I hope you get a definite EUREKA! moment!

Last edited by Sane; Nov 19th, 2007 at 2:23 AM.
Sane is offline   Reply With Quote