PYTHON User Input MCQ
Python MCQ- Home
- Tutorials
- Python
- User Input
- Multiple Choice Question
(1) which of following function was used in python 2 for taking input?
A) raw()
B) input()
C) raw_input()
D) input_raw()
Explanation
raw_input() was used in older python versions till python 2.
(2) Input taken using input function can be converted into following data type.
A) int
B) char
C) string
D) Any of these
Explanation
We can cast input taken using input function into any required data type.
(3) In python what is the default type of input data taken using input() function?
A) String
B) Integer
C) Decimal
D) Object
Explanation
Input method return input data in the form of string. Further we can cast this input to integer or other data type for processing.
(4) Parameter of python input() function is called.
A) String
B) Queue
C) Prompt
D) Display
Explanation
In python a string is provided to the input function. This string is called prompt message.
(5) In python how many parameters of input function?
A) One
B) Two
C) Three
D) Four
Explanation
input function take single parameter as prompt message.
(6) In python which of the following function is used to get input from user.
A) scanf()
B) getch()
C) input()
D) read()
Explanation
input() function is used for input purpose in python. Prompt message can be provided as parameter to input function.