Bird
0
0

What will this Python code print?

medium📝 Predict Output Q4 of 15
Python - Basics and Execution Environment
What will this Python code print?
print(type(42))
A42
Bint
Cnumber
D<class 'int'>
Step-by-Step Solution
Solution:
  1. Step 1: Understand the type() function

    type() returns the type object of the value passed.
  2. Step 2: Check the type of 42

    42 is an integer, so type(42) returns as a string representation.
  3. Final Answer:

    <class 'int'> -> Option D
  4. Quick Check:

    type(42) = <class 'int'> [OK]
Quick Trick: type() shows the data type with format [OK]
Common Mistakes:
MISTAKES
  • Expecting just 'int' without class tags
  • Thinking it prints the number itself

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes