Who may suggest the most convenient and easy way to define single (not iterable or hashable) named CONSTANT in Python? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Who may suggest the most convenient and easy way to define single (not iterable or hashable) named CONSTANT in Python?

24th May 2020, 2:20 PM
John
John - avatar
1 Answer
+ 2
Python is a dynamically typed language and does not support (and has no use of) constants in their pure sense. By convention, you declare variables you'd like to remain unchanged with capital letters. But that's pretty much best you can do.
24th May 2020, 2:56 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar