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.
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:
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!