Questions: Basic Input and Output

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

A student writes `age = input('Enter your age: ')` then `result = age + 1`. When they run the program and type 25, it crashes with a TypeError. What is the most likely cause?

Ainput() is not a valid Python function for reading user data
Bage holds the string '25', and you cannot add an integer to a string without explicit type conversion
CThe variable name age is reserved and cannot be used
Dprint() must be called before input() can work correctly
Question 2 Multiple Choice

A user runs a Python program and types the number 42 when prompted by input(). What is the data type of the value stored in the variable?

Aint — Python automatically converts digits to integers
Bfloat — all console values are stored as floating-point
Cstr — input() always returns a string regardless of what the user types
DThe type depends on what the user typed
Question 3 True / False

In Python, when a user types a number at the keyboard prompt, input() automatically returns an integer value ready for arithmetic.

TTrue
FFalse
Question 4 True / False

Including a clear, descriptive prompt with a trailing space — such as 'Enter your age: ' — is a best practice because it tells the user what to type and where the cursor is.

TTrue
FFalse
Question 5 Short Answer

Why does console input always arrive as a string, and what must a programmer do before using that input in arithmetic calculations?

Think about your answer, then reveal below.