What is raw_input? (NCERT Class 11th)
Answers
Answered by
0
raw_input is a form of input that takes the argument in the form of a string whereas the input function takes the value depending upon your input.
- Say, a = input(1) returns a as an integer with value 1 whereas a=raw_input(1) returns a as a string of "1"
- The raw_input function prompts you for input and returns that as a string.
- The raw_input() function reads a line from input (i.e. the user) and returns a string by stripping a trailing newline
THANKS!!
Answered by
0
1.Raw_input is used to take the argument in the form of a string.
2.Raw_input helps in taking input as it is given by the user i.e in the form of string.
3.Raw_input helps in reading data from a standard input in Python 2.The function of Raw_input is used to treat the received data as string even without quotes.
Similar questions