Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
Python

Variables and Constants in Python

Store values in variables and follow naming conventions for constants.

Python Tutorial Series (8/95). Prefer one article? Read the complete Python tutorial.

Short description

Python variables are created by assignment. Constants are a convention (UPPER_SNAKE_CASE), not enforced by the language.

Variables

age = 25
price = 99.5
is_active = True
PI = 3.14159  # constant by convention
print(age, price, is_active, PI)

Leave a reply

Your email address will not be published. Required fields are marked *