Home > Backend Development > Python Tutorial > Is python case sensitive when assigning values?

Is python case sensitive when assigning values?

anonymity
Release: 2019-06-14 09:55:25
Original
5220 people have browsed it

Is python assignment case sensitive?

Is python case sensitive when assigning values?

Example practice:

If you can distinguish 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 defined
Copy after login

As you can see, there is a NameError here, so python is case-sensitive

The above is the detailed content of Is python case sensitive when assigning values?. 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