Raw_input vs input


When you ask a question, don’t forget to include a link to the exercise or project you’re dealing with!

If you want to have the best chances of getting a useful answer quickly, make sure you follow our guidelines about how to ask a good question. That way you’ll be helping everyone – helping people to answer your question and helping others who are stuck to find the question and answer! :slight_smile:

I’m use to the input () but I’ve noticed that the “control flow” exercise asked for raw_input().

answer=raw_input("The left…)

What is the difference between input() and raw_input()?


For python2 i assume? given raw_input does no longer exist in python3.

raw_input() is the function you want to use in python2, input() will evaluate the input as code.


So, going forward, in Python 3, I will use input() rather than raw_input()?



yes, but understanding why and how might be quite valuable: