Menu
Coddy logo textTech

Arithmetic Operators

Part of the Fundamentals section of Coddy's Python journey. Lesson 10 of 77.

Operators are used to perform operations on values. 

First we will discuss the most basic arithmetic operators, they may be familiar from math classes.

OperatorOperationExample
+Addition3 + 2 = 5
-Subtraction3 - 2 = 1
*Multiplication3 * 2 = 6
/Division4 / 2 = 2.0

Let's see a usage example.

a = 3
b = 5
c = a + b # c holds 8
challenge icon

Challenge

Beginner

Write a code that initializes two variables, a and b, with the values 5.2 and 2.6 (respectively).

After that, initialize another variable c that will hold the result of a / b.

Try it yourself

# Type your code below


# Don't change the line below
print(f"a = {a}, b = {b}, c = {c}");
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Fundamentals

Practice on your own: Online Python compiler