Advertisement
jinglis

List of Variable Names

Aug 27th, 2014
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.94 KB | None | 0 0
  1. # Name: James Inglis
  2. # Syntax: Python
  3. # Date: 8/27/14
  4. # Description: Writing about the illegal and legal variable names
  5. #              to use in python.
  6. #
  7.  
  8. print("\t\t illegal \t\t legal")
  9. print("\n\t\t 23423\t\t calTax")
  10. print("\n\t\t _yes\t\t cal_tax")
  11.  
  12.  
  13. print("\n 23423 is illegal because it's all numbers")
  14. print("\n _yes is illegal because you don't start a variable name with an" +
  15.       "underscore")
  16.  
  17. print("\n\n calTax is legal because it's camel case and it the variable name" +
  18.       "serves a purpose")
  19. print("\n cal_tax is legal because more than two word variable name can be" +
  20.       "separated by an underscore")
  21.  
  22. print("\n\n \t Good \t\t Bad")
  23. print("\n \t   sum \t\t  yes")
  24.  
  25. print("\n\n Sum is a good variable name because it the name of the" +
  26.       "total addition of two oprands")
  27. print("\n\n Yes is a bad variable name because what would be the purpose of" +
  28.       "that variable")
  29.  
  30. input("Press any key to exit!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement