Locked learning resources

Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Locked learning resources

This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Defining Python Constants for Code Maintainability (Summary)

Now you know what constants are, as well as why and when to use them in your code. You also know that Python doesn’t have strict constants. The Python community uses uppercase letters as a naming convention to communicate that a variable should be used as a constant. This naming convention helps to prevent other developers from changing variables that are meant to be constant.

Constants are everywhere in programming, and Python developers also use them. So, learning to define and use constants in Python is an important skill for you to master.

In this video course, you learned how to:

  • Define Python constants in your code
  • Identify and understand some built-in constants
  • Improve you code’s readability, reusability, and maintainability with constants
  • Use different strategies to organize and manage constants in a real-world project
  • Apply various techniques to make your Python constants strictly constant

With this knowledge about what constants are, why they’re important, and when to use them, you’re ready to start improving your code’s readability, maintainability, and reusability immediately. Go ahead and give it a try!

Download

Course Slides (.pdf)

5.9 MB
Download

Sample Code (.zip)

6.0 KB

Become a Member to join the conversation.