Hi! I want use a constant in Python for 2 classes. Which is the better way? Thanks in advance!
MY_COLOR = "#000001" # <-------- Are correct here?
BLACK = "#000000" # <-------- Are correct here?
class One:
MY_FONT = "monospace"
def __init__(self):
if MY_COLOR == BLACK:
print("It's black")
if self.MY_FONT == "monospace":
print("Font equal")
class Two:
def __init__(self):
if MY_COLOR == BLACK:
print("It's black")