PythonByteSize
  • Home
  • Video Index
    • 1. The Basics
    • 2. Python Program Structures
    • 3. Python Operators
    • 4. Python Functions
    • 5. Introduction to Classes and Objects
    • 6. Python Strings
    • 7. User Defined Functions
    • 8. Classes and Objects
    • 9. Python Dictionaries
    • 10. Python tkinter
    • 11. Python Lists
    • 12. Python Namespaces
    • 13. Turtle Graphics
    • 14. Python Tips
    • 15. Complex Numbers
  • 1-Minute Videos
  • Exercise Index
    • 1. The Basics Exercises
    • 2. Python Program Structures Exercises
    • 3. Python Operators Exercises
    • 4. Python Functions Exercises
  • Donate
  • Computing Topics
  • Mathematics
  • Educators
  • Contact
  • About

Exercise 1.12. (Naming Python Variables)

the_basics_lesson_12_exercise.pdf
File Size: 206 kb
File Type: pdf
Download File


1. Ensure you have viewed the video (associated with this exercise) at this link >>

2. How would you alter the following program to ensure it was consistent with the recommendations for variable identifiers (as recommended in the  video)?
Picture

3. The following program will calculate the gross pay from the hours worked and rate of pay per hour entered by a user of the program. How would you amend the program to ensure it met the recommendations outlined in the video?
Picture

4. For the program above give reasons why the choice of the variable identifiers used in the program are not advised.

5. Listed below are snippets of Python code which snippets contain variable identifiers that ‘will not work’ (i.e. which are illegal)?
Picture

END    Next Exercise>>

Please consider donating to help with the costs incurred in developing this website.             Donate >>