Naming

In previous lessons, we've been naming variables with an eye for what is appropriate for Python. There are some hard and fast rules when it comes to naming variables, so let's go over these here. All variable names must:

  • Start with a letter or an underscore
  • Only contain letters, numbers, or the underscore symbol

As such the names: a1 b_2, and _b2, are all okay. However names such as 1a, c-d, or c.d are all no-goes.

Try commenting out any of the lines below and see what happens.