1

i was trying to ask if python supports Contstants? i was trying but it didn't work

I was expecting if i store 5(or something else) in a Capital word(for exaple: CONSTANT = 5) it will be constant.

thanks for the attention, Haroon Zaffar

0

1 Answer 1

0

Python 3.8 introduces the typing.Final type qualifier, which is used to indicate that a variable or attribute should not be reassigned, redefined, or overridden. See link to other StackOverflow answer.

But you do not have constants before that. There are always hacky ways, see link to other StackOverflow answer.

Link

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.