Home  >  Article  >  Backend Development  >  What are the keywords for defining classes in python

What are the keywords for defining classes in python

王林
王林Original
2020-06-12 14:43:1317757browse

What are the keywords for defining classes in python

#The class keyword is used in python to define classes.

The naming rule for classes is that the first letter of each word must be capitalized.

The syntax format for defining a class:

class ClassName:
    <statement-1>
    .
    .
    .
    <statement-N>

What is a class?

A class is used to describe a collection of objects with the same properties and methods. It defines the properties and methods common to each object in the collection. Each object is an instance of a class. .

Recommended tutorial: python tutorial

The above is the detailed content of What are the keywords for defining classes in python. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn