Constants in Logo

Python supports constants for character, string, boolean, and numeric values.

```python
import math

# Constants are declared by assigning a value to a variable in uppercase.
S = "constant"

def main():
    print(S)
    
    # Constants can appear anywhere a variable can
    N = 500000000
    print(3e20 / N)

    # In Python, constants usually don't have a dedicated type.
    D = 3e20 / N
    print(int(D))

    # Numeric constants are given a type by using them in a context that requires it.
    # For example, the math.sin function expects a float
    print(math.sin(N))

if __name__ == "__main__":
    main()

To run the program, save the code in a file named constants.py and use the Python interpreter.

$ python constants.py
constant
6e+11
600000000000
-0.28470407323754404

In this example, constants are declared by assigning values to variables written in all uppercase letters. We then use these constants in various operations and functions.

Next example: For