Multiple choice python

print type([1,2]).The output is:

  1. <type 'tuple'>

  2. <type 'int'>

  3. <type 'complex'>

  4. <type 'list'>

  5. <type ‘Dictionary’>

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The type() function in Python 2.x returns the type of the object passed to it. [1,2] is a list literal, so type([1,2]) returns . This is a straightforward type checking question. The other options are incorrect because tuples use parentheses (), integers are just numbers, and complex numbers require a 'j' suffix or complex() function.