0

I am trying to figure out a way of declaring a variable whose value can not be changed in any way (static in c++), but in python3. Please let me know how.

Avinash
  • 133
  • 9
  • 3
    Possible duplicate of [Static class variables in Python](https://stackoverflow.com/questions/68645/static-class-variables-in-python) – Sam M Nov 19 '17 at 04:36
  • 3
    IIRC this is not what "static" means in c++. Sounds like what you're looking for is something similar to Java's `final` keyword. AFAIK there is no such thing in Python – Nir Alfasi Nov 19 '17 at 04:36
  • 1
    Possible duplicate of [how to set global const variables in python](https://stackoverflow.com/questions/18224991/how-to-set-global-const-variables-in-python) – John1024 Nov 19 '17 at 04:50

1 Answers1

3

there is no way of creating a const variable in python3, but there are some option and recommendation too, check the link below- how to set global const variables in python

shahin mahmud
  • 945
  • 4
  • 11