Forum Archive

How do we use raw_input()?

NickAtNight

I don't see a raw_input() command.

Input() works.

But how do I use raw_input()

abcabc

raw_input() was renamed to input() in Python v3.x
http://stackoverflow.com/questions/10885537/raw-input-has-been-eliminated-from-python-3-2

NickAtNight

Ah, ok.

Was that when the also started requiring () with print statements?

uj_jonas

@NickAtNight Yes. In Python 3 print is a function.
If you want to run your script to run in Python 2 you could add
#! python2 at the top of your script like this:

#! python2

var = raw_input('using raw_input()')
print 'python 2 print'

You can also test your script in Python 2 by holding down the play button and choosing "Run with Python 2.7"

NickAtNight

Cool. Thank you