Search⌘ K
AI Features

Everything is Case-Sensitive

Explore how Python treats all names as case-sensitive including variables, functions, and classes. Understand the importance of precise casing when defining or using names to avoid errors in your first Python program.

We'll cover the following...

All names in Python are case-sensitive: variable names, function names, class names, module names, exception names. If you can get it, set it, call it, construct it, import it, or raise it, it’s case-sensitive.

Python 3.5
an_integer = 1
print (an_integer)
#1
Python 3.5
AN_INTEGER
#Traceback (most recent call last):
# File "/usercode/__ed_file.py", line 1, in <module>
# AN_INTEGER
#NameError: name 'AN_INTEGER' is not defined
Python 3.5
An_Integer
#Traceback (most recent call last):
# File "/usercode/__ed_file.py", line 1, in <module>
# An_Integer
#NameError: name 'An_Integer' is not defined
Python 3.5
an_inteGer
#Traceback (most recent call last):
# File "/usercode/__ed_file.py", line 1, in <module>
# an_inteGer
#NameError: name 'an_inteGer' is not defined