Skip to content

Instantly share code, notes, and snippets.

@mh0w
Created October 21, 2022 15:03
Show Gist options
  • Save mh0w/1e617227722c10cb1534caa19f1850b6 to your computer and use it in GitHub Desktop.
Save mh0w/1e617227722c10cb1534caa19f1850b6 to your computer and use it in GitHub Desktop.
get the class name of an object
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