Home Tutorials Python OOP Concepts Class
Class

Class


1. Class

A class is a user-defined template for creating objects. It defines attributes and methods that the created objects will use.

Syntax

class Student:
    pass

Example

class Student:
    name = "Ramesh"

print(Student.name)

Output

Ramesh
Example

🏋️ Test Yourself With Exercises

Take our quiz on Class to test your knowledge.

Browse Quizzes »