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.

1
  • Just don't assign a new value to the name. Commented Jul 29, 2015 at 18:04

1 Answer 1

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…

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.