Home >Backend Development >Python Tutorial >Is int a reserved word in Python?

Is int a reserved word in Python?

(*-*)浩
(*-*)浩Original
2019-07-06 11:42:047958browse

Identifiers in Python are names used to identify variables, functions, classes, modules, and other objects. Identifiers can contain letters, numbers, and underscores (_), but they must start with a non-numeric character. The alphabet consists only of A–Z and a–z in the ISO-Latin character set. Identifiers are case-sensitive, so FOO and foo are two different objects.

Is int a reserved word in Python?

int is a class in python. It is one of the immutable data types. Some of its properties are the same as strings. It is an integer type. (Recommended learning: Python video tutorial)

Special symbols, such as $, %, @, etc., cannot be used in identifiers. In addition, words such as if, else, for, etc. are reserved words and cannot be used as identifiers.

The following table lists all reserved characters:

Is int a reserved word in Python?

All reserved words in python are case-sensitive .

Python reserved words can be viewed by entering the following two lines of code in IDLE:

import keyword
keyword.kwlist

Note:

Chinese characters are allowed as identifiers in Python , but its use is not recommended.

For more Python related technical articles, please visit the Python Tutorial column to learn!

The above is the detailed content of Is int a reserved word 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