Bird
0
0

What is the output of this code?

medium📝 Predict Output Q4 of 15
Python - Variables and Dynamic Typing
What is the output of this code?
value = [1, 2, 3]
print(type(value) == list)
ATypeError
BTrue
Clist
DFalse
Step-by-Step Solution
Solution:
  1. Step 1: Identify the variable type

    The variable value is a list of integers, so its type is list.
  2. Step 2: Evaluate the comparison

    The expression type(value) == list compares the type of value to list, which is True.
  3. Final Answer:

    True -> Option B
  4. Quick Check:

    List type check returns True [OK]
Quick Trick: type() == list returns True for list variables [OK]
Common Mistakes:
MISTAKES
  • Expecting output 'list' instead of True
  • Confusing type with value
  • Syntax errors in comparison

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes