What will be the output of the following code : print type(type(int)
Answers
Answered by
22
Given: print type ( type ( int ) )
To find: The output of the following code.
Solution:
- So we have provided with a code as print type ( type ( int ) ) .
- Now we know that type() method returns class type of the argument(object) passed as parameter.
- So in this also, the type() function is returning the class of the argument the object belongs to.
- Thus, type ( int ) returns the output as type ‘type’, which is of the type ‘type’ object.
- In some compilers, it shows "invalid syntax" errors, so in that case the code should be written as:
print ( type ( type ( int ) ) )
Answer:
So the output is type ‘type’.
Similar questions