How do I use raw_input( )?
raw_input() is a method that prints what you put inside to the console, waits for the user to type something, and returns whatever they typed after the
enter key is pressed. This is a common mistake:
raw_input(“Enter something here: “) my_variable = raw_input()
This doesn’t work because
raw_input() is a method, so it’s simply going to use it each time you write it. By writing it by itself on the first line above, it just performs the method and moves on in the program to the next line without having assigned that value anywhere. Then on the second line, it runs
raw_input() again, but with no prompt, so the user is just met with a blinking cursor and won’t know they’re being prompted for input.
The instructions show a great example of using this method properly to store the user’s input into a variable:
name = raw_input("What's your name?").