What is raw_input in Python
The raw_input()
function is similar to input() function. But you cannot use raw_input() in Python 3.x. Because this function is removed from Python 3.x versions. But it exists in Python 2.x.
The raw_input()
function takes string as input.
Syntax: raw_input
([prompt])
If the prompt argument is present, it is written to standard output without a trailing newline. The function then reads a line from input, converts it to a string (removing a trailing newline), and returns that. When EOF is read, EOFError
is raised.
>>> s = raw_input('!!!') !!! Python Point >>> s "Python Point"
Reference: Official documentation
Subscribe
Login
Please login to comment
0 Discussion