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

Is python case sensitive when assigning values?

anonymity
anonymityOriginal
2019-06-13 17:18:525165browse

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

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!

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
Previous article:How python shell runsNext article:How python shell runs