Posts Python Variables
Post
Cancel

Python Variables

Variable naming convention

As seen in previous post Variables in python are dynamic data types itself.

Things to follow while naming a variable

  • Names can’t begin with numbers
  • Spaces are not allowed in the name (If there best is to join using _ eg: Hello_world)
  • Best pracitices is to keep names as lowercase
  • Any symbols are not allowed to be part of a variable name (Eg: ¢£!@)
  • Can’t use Python reserved words as a variable name

Reserved words

1
Reserved words are small set of words that are reserved to perform internal functionality.

Below are the current set of reserved words as of 23 Nov 2021. You can easily check it out using help("keywords")

1
2
3
4
5
6
7
8
9
10
11
12
13
>>> help("keywords")

Here is a list of the Python keywords.  Enter any keyword to get more help.

False               class               from                or
None                continue            global              pass
True                def                 if                  raise
and                 del                 import              return
as                  elif                in                  try
assert              else                is                  while
async               except              lambda              with
await               finally             nonlocal            yield
break               for                 not


——- Thanks for reading till end.

Followus on @techpechu

Join Our Discord

We do run a youtube channel in Indian regional language Tamil called TechPechu. Do subscribe us for moral support. Happy Learning.

Follow us on instagram @techpechu