Naming Rules in Python



Names(Variable Names) are case sensitive and cannot start with a number. They can contain letters and underscores.

Example:-

bob, Bob, _bob, _2_bob_, bob_2, BoB, BOB

There are some reserved words:-

asfinallypass
and forprint
assert fromraise
break globalreturn
class iftry
continue importsmile
def in false
delistrue
eliflambdawhile
elsenotwith
exceptnoneyield
execor

These reserved words are also called Python Keywords.



2 thoughts on “Naming Rules in Python

Leave a comment