- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to get the class name of an instance in Python?
The following code shows how to get the class name of the instance in question.
class Number: def __init__(self, number): self.number = number n1 = Number(1) print n1.__class__ print n1.__class__.__name__
This gives the output
- How to implement an instance method reference using a class name in Java?
- How many ways can get the instance of a Class class in Java?
- How to create an instance of an abstract class in Kotlin?
- Get the fully-qualified name of an inner class in Java
- Get the unqualified name of a class in Java
- Class & Instance Attributes in Python
- How to get css class name using Selenium?
- Get the fully-qualified name of a class in Java
- Python How to get function name?
- Get the class name for various objects in Java
- How to create an instance of an anonymous interface in Kotlin?
- Get Canonical Name for a class in Java
- How to get the name of the current executable in C#?