Is Python case-sensitive?
Yes, Python is case-sensitive. This means name, Name and NAME are three different identifiers. The same is true for keywords: True works, but true does not.
name = "Robin"
print(Name)
Output:
Tutorials Class - Output Window
Traceback (most recent call last):
File "main.py", line 2, in <module>
print(Name)
NameError: name 'Name' is not defined. Did you mean: 'name'?
A wrong capital letter is one of the most common mistakes for beginners, so check the spelling first when you see a NameError. The “Did you mean” hint is shown by Python 3.10 and above. See Python Variables for naming rules.
Learn more about the similar topics:
| Tutorials |
|---|
| No Content Found. |
| Exercises & Assignments |
|---|
| No Content Found. |
| Interview Questions & Answers |
|---|
| No Content Found. |