Python by example

Values in Python

In Python, a value is a piece of data that can be assigned to a variable or used in an expression. There are different types of values in Python, such as integers, floats, strings, and booleans.

Here are some examples of values in Python:

# Integer value
x = 42
# Float value
y = 3.14
# String value
name = "John Carmack"
# Boolean value
is_active = True
Next example: Numbers