Created
October 21, 2022 15:03
-
-
Save mh0w/1e617227722c10cb1534caa19f1850b6 to your computer and use it in GitHub Desktop.
get the class name of an object
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = "x" | |
b = 1 | |
c = 1.2 | |
print(a.__class__.__name__) # str | |
print(b.__class__.__name__) # int | |
print(c.__class__.__name__) # float |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment