Type function in Python

0 votes

.I know that type() function is used to return the class type of parameter.I wrote the below code

class try1 :
  a = 0

print(type(try1()))                        # line 1
print(type(try1))                           # line 2
print(type(type(try1)))                 #line 3
print(type(type(try1())))               #line 4

The output were as follows 

<class '__main__.try1'>
<class 'type'>
<class 'type'>
<class 'type'>

I was able to understand the out of "#line 1 " . But I am not able to get why it is showing class type as 'type' for the other 3 line. Can anyone please explain it to me a bit clearly. I will be very grateful to them.

Thank You

Jul 10, 2021 in Python by Brijesh
• 120 points

edited 4 days ago 7 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP