The input() function in Python returns:
-
A
An integer
-
B
A string
Correct answer
-
C
A float
-
D
A boolean
Correct answer
B. A string
11 views
Explanation
input() always returns a string. If you need a number, you must convert it with int() or float(). This is a common beginner mistake.
Reference
Asked in: Matric,FBISE
Doubts & discussion
Not sure why the answer is B? Ask here and get an explanation.
Ask a doubt about this MCQ