0
What is the difference between input() and raw_input() in python?
please explain with suitable example
3 Answers
+ 1
in python 2.x, input() return python datatype based on user input, eg. it return a list when user enter [1,2,3]. while raw_input() return raw string. It return as string '[1,2,3]' when user enter [1,2,3].
in python 3.x, input() is equivalant to raw_input() of python 2.x.
0
Input() is from the newer version of python, 3.x. raw_input is from versions 2.x.
0
ok thank you