How to define a constant in Python?
A constant is a type of variable that holds values, which cannot be changed. In reality, we do not use constants in Python. There is no predefined type for a constant variable in Python. But we can use pconst library for that.
# import module from pconst import const # define your constants const.LANGUAGE = "SPANISH" const.COMPANY = 'EL GORAUGY' # print your constants print(const.LANGUAGE) print(const.COMPANY)
You cannot update your constants or use del operator for the variables defined with pconst.