Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Simple Math Operations | Getting Started
Introduction to Python Video Course
course content

Conteúdo do Curso

Introduction to Python Video Course

Introduction to Python Video Course

1. Getting Started
2. Variables and Types
3. Conditional Statements
4. Other Data Types
5. Loops
6. Functions

Simple Math Operations

Great job so far! In Python, performing math operations is straightforward yet powerful, perfectly suited for managing tasks in our grocery store.

We can utilize basic arithmetic operators for diverse calculations:

  • + for addition;
  • - for subtraction;
  • * for multiplication;
  • / for division.

Let's see Alex demonstrate these basic arithmetic operators:

Now, it's your turn to practice using them. To display the results of our calculations, we will be using the print() function. Unlike strings (i.e., text), mathematical expressions do not require quotation marks. We will learn more about this later in the course.

Let's explore some practical examples from our grocery store setting:

1234567891011
# Addition: Calculate the total inventory of apples and oranges. print(150 + 230) # Subtraction: Determine how many apples remain after selling 123. print(150 - 123) # Multiplication: Compute the total cost for 15 packs of butter, each priced at $2.25. print(15 * 2.25) # Division: Find the average price of 4 bananas if the total cost is $4.60. print(4.60 / 4)
copy

Now, it's your turn to complete the following mathematical operations. Fill in the blanks to complete the print statements and run the code:

Tarefa

  1. Use addition to calculate the total cost of milk ($5.42) and bread ($4.39).
  2. Use multiplication to calculate the cost of a 3.5-pound bag of oranges ($1.20 per pound).
  3. Use division to calculate the average cost per item if a customer bought 5 items and spent a total of $55.

Tarefa

  1. Use addition to calculate the total cost of milk ($5.42) and bread ($4.39).
  2. Use multiplication to calculate the cost of a 3.5-pound bag of oranges ($1.20 per pound).
  3. Use division to calculate the average cost per item if a customer bought 5 items and spent a total of $55.

Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo

Tudo estava claro?

Seção 1. Capítulo 3
toggle bottom row

Simple Math Operations

Great job so far! In Python, performing math operations is straightforward yet powerful, perfectly suited for managing tasks in our grocery store.

We can utilize basic arithmetic operators for diverse calculations:

  • + for addition;
  • - for subtraction;
  • * for multiplication;
  • / for division.

Let's see Alex demonstrate these basic arithmetic operators:

Now, it's your turn to practice using them. To display the results of our calculations, we will be using the print() function. Unlike strings (i.e., text), mathematical expressions do not require quotation marks. We will learn more about this later in the course.

Let's explore some practical examples from our grocery store setting:

1234567891011
# Addition: Calculate the total inventory of apples and oranges. print(150 + 230) # Subtraction: Determine how many apples remain after selling 123. print(150 - 123) # Multiplication: Compute the total cost for 15 packs of butter, each priced at $2.25. print(15 * 2.25) # Division: Find the average price of 4 bananas if the total cost is $4.60. print(4.60 / 4)
copy

Now, it's your turn to complete the following mathematical operations. Fill in the blanks to complete the print statements and run the code:

Tarefa

  1. Use addition to calculate the total cost of milk ($5.42) and bread ($4.39).
  2. Use multiplication to calculate the cost of a 3.5-pound bag of oranges ($1.20 per pound).
  3. Use division to calculate the average cost per item if a customer bought 5 items and spent a total of $55.

Tarefa

  1. Use addition to calculate the total cost of milk ($5.42) and bread ($4.39).
  2. Use multiplication to calculate the cost of a 3.5-pound bag of oranges ($1.20 per pound).
  3. Use division to calculate the average cost per item if a customer bought 5 items and spent a total of $55.

Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo

Tudo estava claro?

Seção 1. Capítulo 3
toggle bottom row

Simple Math Operations

Great job so far! In Python, performing math operations is straightforward yet powerful, perfectly suited for managing tasks in our grocery store.

We can utilize basic arithmetic operators for diverse calculations:

  • + for addition;
  • - for subtraction;
  • * for multiplication;
  • / for division.

Let's see Alex demonstrate these basic arithmetic operators:

Now, it's your turn to practice using them. To display the results of our calculations, we will be using the print() function. Unlike strings (i.e., text), mathematical expressions do not require quotation marks. We will learn more about this later in the course.

Let's explore some practical examples from our grocery store setting:

1234567891011
# Addition: Calculate the total inventory of apples and oranges. print(150 + 230) # Subtraction: Determine how many apples remain after selling 123. print(150 - 123) # Multiplication: Compute the total cost for 15 packs of butter, each priced at $2.25. print(15 * 2.25) # Division: Find the average price of 4 bananas if the total cost is $4.60. print(4.60 / 4)
copy

Now, it's your turn to complete the following mathematical operations. Fill in the blanks to complete the print statements and run the code:

Tarefa

  1. Use addition to calculate the total cost of milk ($5.42) and bread ($4.39).
  2. Use multiplication to calculate the cost of a 3.5-pound bag of oranges ($1.20 per pound).
  3. Use division to calculate the average cost per item if a customer bought 5 items and spent a total of $55.

Tarefa

  1. Use addition to calculate the total cost of milk ($5.42) and bread ($4.39).
  2. Use multiplication to calculate the cost of a 3.5-pound bag of oranges ($1.20 per pound).
  3. Use division to calculate the average cost per item if a customer bought 5 items and spent a total of $55.

Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo

Tudo estava claro?

Great job so far! In Python, performing math operations is straightforward yet powerful, perfectly suited for managing tasks in our grocery store.

We can utilize basic arithmetic operators for diverse calculations:

  • + for addition;
  • - for subtraction;
  • * for multiplication;
  • / for division.

Let's see Alex demonstrate these basic arithmetic operators:

Now, it's your turn to practice using them. To display the results of our calculations, we will be using the print() function. Unlike strings (i.e., text), mathematical expressions do not require quotation marks. We will learn more about this later in the course.

Let's explore some practical examples from our grocery store setting:

1234567891011
# Addition: Calculate the total inventory of apples and oranges. print(150 + 230) # Subtraction: Determine how many apples remain after selling 123. print(150 - 123) # Multiplication: Compute the total cost for 15 packs of butter, each priced at $2.25. print(15 * 2.25) # Division: Find the average price of 4 bananas if the total cost is $4.60. print(4.60 / 4)
copy

Now, it's your turn to complete the following mathematical operations. Fill in the blanks to complete the print statements and run the code:

Tarefa

  1. Use addition to calculate the total cost of milk ($5.42) and bread ($4.39).
  2. Use multiplication to calculate the cost of a 3.5-pound bag of oranges ($1.20 per pound).
  3. Use division to calculate the average cost per item if a customer bought 5 items and spent a total of $55.

Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Seção 1. Capítulo 3
Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
We're sorry to hear that something went wrong. What happened?
some-alt