+ 3

Difference in raw_input and input???

26th Aug 2016, 8:11 AM
Gaurav Dhruw
3 Respostas
+ 2
raw_input() returns a string whereas input() treats the input like runnable code. So input from input() can be used to call functions for example.
26th Aug 2016, 8:59 AM
Doc
Doc - avatar
+ 1
Well it depends on the version of python. If I recall correctly in python 3.x there's only input() and it returns a string. If you want to turn it into runnable code, you have to apply eval() on the string.
26th Aug 2016, 12:35 PM
Doc
Doc - avatar
- 1
@Doc Exactly the other way around.
26th Aug 2016, 11:25 AM
dead
dead - avatar