raw_input confusion


so I'm taking computer science 110 atm and the way we learned to do input is to put eval(input("blah blah blah") and I'm not entirely sure what the difference is with raw_input. I looked it up on the internet and I couldn't find an explanation only that raw input is not used in the current version of python. could someone explain to me (in detail if possible) the difference of these methods or what raw input used to do because i'm very confused


In Python2.x to prompt user for input the command is


In Python3.x to prompt user for input the command is(the command was changed to this)



oh so essential they are just the same thing?


Yes they perform the same task. Just exist in different releases of the language


alright one last question where does eval(input( come into play


eval() interprets a string as code.It lets a python program run python code within itself. try this in the editor you are using

print(eval(input("Enter a mathematical expression")))
#if you put in 2*(4+6) you get ==> 20

def double(number):
    return number*2
for i in range(5):
    print (eval("double(i)"))


Did you get it? Were you able to run it


may be a bit late but yes i did get it Thanks