what is the difference between input and raw input statement
Home
/
Computer Science
/
what is the difference between input and raw input statement
what is the difference between input and raw input statement
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Answer:
Raw Input :-
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(5) returns a as an integer with value 5 whereas a=raw_input(5) returns a as a string of "5" .
Input Statement :-
An input statement or IO statement is a portion of a program that instructs a computer how to read and process information.
It pertains to gather information from an input device, or sending information to an output device .
→ Basically, the difference between raw_input and input is that the return type of raw_input is always string, while the return type of input need not be string only.
→ Python will judge as to what data type will it fit the best. In case you have entered a number, it will take it as an integer.
The BadSoorat here ✌