Home > Backend Development > Python Tutorial > Is python case sensitive?

Is python case sensitive?

青灯夜游
Release: 2023-01-03 09:28:49
Original
19482 people have browsed it

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.

Is python case sensitive?

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 &#39;Myname&#39; is not define
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template