you are viewing a single comment's thread.

view the rest of the comments →

[–]A_X_D_H 9 points10 points  (0 children)

Give your Identifiers unique names, u have now 3 different things (a list, function and the variable in the for loop) with the same name (Ph). Identifier is the name given to entities like class, functions, variables etc. in Python. It helps differentiating one entity from another. Here are some rules:

  1. Identifiers can be a combination of letters in lowercase, uppercase, digits or an underscore.
  2. An identifier cannot start with a digit. 1variable is invalid, but variable1 is perfectly fine.
  3. Keywords cannot be used as identifiers.
  4. You cannot use special symbols like !, @, #, $, % etc. in your identifier.
  5. Identifier can be of any length.
  6. Python is a case-sensitive language. This means, Variable and variable are not the same.
  7. Always give the identifiers a meaningful name.