How do I create a constant in Python?

In Python, a constant is typically defined as a variable that is assigned a value that should not be modified later on in the program. To create a constant in Python, you can use an uppercase variable name and assign it a value, as in the following example:

PI = 3.14

Watch a course Python - The Practical Guide

It is a convention in Python to use uppercase variable names for constants, although this is not enforced by the language itself. However it is not a language level feature and you are free to use any naming conventions and methods to make sure the variable is not modified later on in the program.