0 like 0 dislike
4 views
What is Class in Python?
in Python Coding by Wooden (1.3k points) | 4 views

1 Answer

0 like 0 dislike
Best answer

Python supports object-oriented programming and provides almost all OOP features to use in programs.

A Python class is a blueprint for creating the objects. It defines member variables and gets their behavior associated with them.

We can make it by using the keyword “class.” An object gets created from the constructor. This object represents the instance of the class.

In Python, we generate classes and instances in the following way.

>>>class Human:  # Create the class
...     pass
>>>man = Human()  # Create the instance
>>>print(man)
<__main__.Human object at 0x0000000003559E10>

 

by Wooden (1.3k points)

No related questions found

Welcome to MathsGee Skills Question and Answer Bank, a platform, where you can ask study questions and receive answers from other members of the community. Help is always 100% FREE!
MathsGee Q&A is the knowledge-sharing community where millions of students and experts put their heads together to crack their toughest homework questions.

Enter your email address:

[consumerlti id="python_coding"]