Basic Arithmetic and Operators
Explore Python's arithmetic operators and how to perform calculations.
Basic Arithmetic and Operators is a free Learn AI with Python lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Learn AI with Python learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
1
Introduction to Arithmetic and Operators
Operators are symbols that perform specific operations on values or variables. Arithmetic operators are used to perform mathematical calculations.
In this lesson, you’ll learn the basic arithmetic operators in Python.

2
Basic Arithmetic Operators
Here are some common arithmetic operators in Python:
+: Addition (e.g.,2 + 3gives5).-: Subtraction (e.g.,7 - 2gives5).*: Multiplication (e.g.,4 * 3gives12)./: Division (e.g.,10 / 2gives5.0).
3
Examples of Arithmetic Operators
Let’s look at some examples:
# Arithmetic operators in Python
a = 10
b = 5
print(a + b) # Addition
print(a - b) # Subtraction
print(a * b) # Multiplication
print(a / b) # Division4
Integer Division and Modulus
Python also provides:
//: Integer Division (e.g.,10 // 3gives3).%: Modulus (remainder) (e.g.,10 % 3gives1).
These operators are useful when you need precise control over division.
# Integer division and modulus
a = 10
b = 3
print(a // b) # Integer division
print(a % b) # Modulus5
Exponentiation
You can raise a number to the power of another using **:
# Exponentiation
result = 2 ** 3
print(result) # 86
Operator Precedence
Python follows the order of operations:
- Parentheses (
()) - Exponentiation (
**) - Multiplication, Division, Modulus (
*, /, %, //) - Addition, Subtraction (
+, -)
For example:
# Operator precedence
result = 2 + 3 * 4
print(result) # 147
Using Parentheses to Change Precedence
You can use parentheses to change the order of operations:
# Changing precedence with parentheses
result = (2 + 3) * 4
print(result) # 208
Combining Arithmetic with Variables
Arithmetic operations can be combined with variables:
# Combining arithmetic with variables
x = 5
y = 2
z = x ** y + x / y
print(z)9
10
What Did We Learn?
In this lesson, you learned:
- The basic arithmetic operators in Python:
+, -, *, /. - How to use
//,%, and**for integer division, modulus, and exponentiation. - The importance of operator precedence and using parentheses to change it.
Great job! Let’s move on to the next topic.

Frequently asked questions
Is the “Basic Arithmetic and Operators” lesson free?
Yes — the full text of “Basic Arithmetic and Operators” is free to read here on the web, and the Learn AI with Python course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Learn AI with Python course, upgrade to CoddyKit PRO.
What will I learn in “Basic Arithmetic and Operators”?
Explore Python's arithmetic operators and how to perform calculations. You practise Learn AI with Python with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Learn AI with Python?
No prior experience is required. Learn AI with Python on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Basic Arithmetic and Operators” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Learn AI with Python lesson?
Yes. Every Learn AI with Python lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Variables and Data Types
- Input and Output
- Basic Arithmetic and Operators
- Comments and Code Readability