2.3 Operators and Expressions
Python Programming
Operators are symbols that perform operations on variables and values. An expression is a combination of variables, operators, and values that produces a result. Let's explore different types of operators in Python.
2.3.1 Arithmetic Operators
Arithmetic operators are used to perform basic mathematical operations such as addition, subtraction, multiplication, division, modulus, exponentiation, and floor division as shown in the following code. The code shows how to use basic arithmetic operations in Python.
python
# Define variables
a= 10
b= 3
# Perform all arithmetic operations on these numeric variables and print results
print(a, "+", b, "=", a + b) # Output: 10+3=13
print(a, "*", b,