Are Python identifiers case-sensitive ?

Python identifiers are case-sensitive, meaning that variable names, function names, and other identifiers must be used consistently with regard to uppercase and lowercase letters.

Examples

variable = 100

Variable = 200

print(variable)

print(Variable)

Output

100
200

Featuresย  ย  ย 

  • Identifiers with different cases are treated as separate and distinct.
  • The exact casing must be used throughout the code

Advantages

  • Allows for more descriptive and varied naming conventions.
  • Can help in distinguishing between variables or functions

ย Uses

  • Enables use of naming conventions that differentiate between different types of identifiers (e.g., myvariable MYVARIABLE).
  • Used to Helps in organizing code
0 Shares:
You May Also Like
Read More

Dictionary in python ?

Definition A dictionary in Python is a collection of key-value pairs, where each key is unique, and values…
Read More

What is Flask in Python ?

Definition Flask is a lightweight, web framework for Python that allows developers to create web applications quickly and…