what is the result if the following statement is executed. print(type( {"1":"book","2":"pen"} ) )
Answers
Answered by
1
OUTPUT.
- <class 'dict'>
EXPLANATION.
• The type() method in Python is used to get the type of the argument.
Example,
a = 2
type(a)
>> <class 'int'>
Here, the argument contains a dictionary. So, type method outputs - <class 'dict'> on the screen.
Similar Examples –
1)
a = 2.0
type(a)
>> <class 'float'>
2)
a = 2
b = type(a)
c = type(b)
>> <class 'type'>
Attachments:
Similar questions