top of page

Variable Naming Conventions in Python

Updated: Apr 19, 2023

The variable names in Python can start with _ or a letter.



It should not start with a number. After that it can contain any combination of _ and alphanumeric characters.




#valid variable names
just_var = "Hello World!"
justvar = "Hello World!"
_just_var = "Hello World!"
justVar = "Hello World!"
JUSTvar = "Hello World!"
JustVar = "Hello World!"
justvar1 = "Hello World!"

#invalid variable names
#1justVar1 = "Hello World"

The link to the Github repository is here .

Subscribe to get all the updates

© 2025 Metric Coders. All Rights Reserved

bottom of page