Home >Backend Development >Python Tutorial >Is python case sensitive?
Python is case-sensitive. Whether it is a variable, function, or class, it must be strictly case-sensitive. For example: page and Page are two different variables, and name and Name are also two completely different variables.
The operating environment of this tutorial: Windows 7 system, Python 3 version, Dell G3 computer.
Is python case sensitive? Let's look at it with an example:
If you can differentiate between identifiers like myname and Myname, then it is case-sensitive. In other words, it cares about uppercase and lowercase.
myname='Ayushi' print(Myname) Traceback (most recent call last): File "E:/py3.6code/xx", line 6, in <module> print(Myname) NameError: name 'Myname' is not define
As you can see, a NameError occurs here, so python is case-sensitive. Whether it is a variable, function, or class, it must be strictly case-sensitive.
【Related recommendations: Python3 video tutorial】
The above is the detailed content of Is python case sensitive?. For more information, please follow other related articles on the PHP Chinese website!