Bird
0
0

Why does input() always return a string even if the user types a number?

hard📝 Conceptual Q10 of 15
Python - Input and Output
Why does input() always return a string even if the user types a number?
ABecause input() only accepts string inputs
BBecause Python automatically converts input to string
CBecause input() converts numbers to strings internally
DBecause input() reads raw text from the keyboard
Step-by-Step Solution
Solution:
  1. Step 1: Understand how input() works

    Input reads exactly what the user types as raw text from the keyboard.
  2. Step 2: Recognize that input() does not convert types

    It returns the raw text as a string, no automatic type conversion happens.
  3. Final Answer:

    Because input() reads raw text from the keyboard -> Option D
  4. Quick Check:

    input() returns raw text string always [OK]
Quick Trick: input() returns raw text, no automatic type conversion [OK]
Common Mistakes:
MISTAKES
  • Thinking input() converts types
  • Assuming input() accepts only strings
  • Confusing input() with eval()

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes