0

Sometime there is a need to define constant numeric values to be used across our application.

For instance in C language I used to do thing like:

#define PI = 3.14
#define MIN = 0
#define MAX = 256

What is the equivalent in Python?

[Edit:] To the down voters. The question is not related to syntax. I'm interested in understanding conventions and doing things right in the Python philosophy.

triple fault
  • 13,410
  • 8
  • 32
  • 45

1 Answers1

2

There is no really equivalent in Python: just convention: uppercase! If you write:

CST = 10

Everyone know that you don't have to change it…

Clodion
  • 1,017
  • 6
  • 12