Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
More Challenging Math | First Acquaintance
Introduction to Python
course content

Course Content

Introduction to Python

Introduction to Python

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

bookMore Challenging Math

Nice work! Python provides several additional math operations, including:

  • // - floor division or integer division;
  • % - modulus or remainder after division;
  • ** - exponentiation or raising to a power.

It's important to note that you can't use the traditional ^ symbol for exponentiation in Python, as it yields a different result. The syntax for these operations mirrors that of basic arithmetic. For example, 18 // 4 results in 4, because we're taking the whole number from the division (the actual result being 4.5). 14 % 5 gives 4, because when we divide 14 by 5, the remainder is 4. 4 ** 3 results in 64, because 4 multiplied by itself three times equals 64.

12345678
# Default division print(18 / 4) # Floor division print(18 // 4) # Remainder of the division print(18 % 4) # Raising to the power of 4 print(18 ** 4)
copy

Task

  • On the second line, compute the floor division of 234 by 32.
  • On the fifth line, determine the remainder when 356 is divided by 17.

Why are these operations helpful?

For instance, picture this scenario: You've got $50 and you want to buy as many cookie packs as possible, with each pack priced at $6. You're trying to figure out the max number of packs you can purchase and the change you'll receive. Using the operations above, you can solve this easily.

  • 50 // 6 gives 8, which means you can buy 8 packs;
  • 50 % 6 results in 2, indicating you'll have $2 left after buying 8 packs.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 1. Chapter 4
toggle bottom row

bookMore Challenging Math

Nice work! Python provides several additional math operations, including:

  • // - floor division or integer division;
  • % - modulus or remainder after division;
  • ** - exponentiation or raising to a power.

It's important to note that you can't use the traditional ^ symbol for exponentiation in Python, as it yields a different result. The syntax for these operations mirrors that of basic arithmetic. For example, 18 // 4 results in 4, because we're taking the whole number from the division (the actual result being 4.5). 14 % 5 gives 4, because when we divide 14 by 5, the remainder is 4. 4 ** 3 results in 64, because 4 multiplied by itself three times equals 64.

12345678
# Default division print(18 / 4) # Floor division print(18 // 4) # Remainder of the division print(18 % 4) # Raising to the power of 4 print(18 ** 4)
copy

Task

  • On the second line, compute the floor division of 234 by 32.
  • On the fifth line, determine the remainder when 356 is divided by 17.

Why are these operations helpful?

For instance, picture this scenario: You've got $50 and you want to buy as many cookie packs as possible, with each pack priced at $6. You're trying to figure out the max number of packs you can purchase and the change you'll receive. Using the operations above, you can solve this easily.

  • 50 // 6 gives 8, which means you can buy 8 packs;
  • 50 % 6 results in 2, indicating you'll have $2 left after buying 8 packs.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 1. Chapter 4
toggle bottom row

bookMore Challenging Math

Nice work! Python provides several additional math operations, including:

  • // - floor division or integer division;
  • % - modulus or remainder after division;
  • ** - exponentiation or raising to a power.

It's important to note that you can't use the traditional ^ symbol for exponentiation in Python, as it yields a different result. The syntax for these operations mirrors that of basic arithmetic. For example, 18 // 4 results in 4, because we're taking the whole number from the division (the actual result being 4.5). 14 % 5 gives 4, because when we divide 14 by 5, the remainder is 4. 4 ** 3 results in 64, because 4 multiplied by itself three times equals 64.

12345678
# Default division print(18 / 4) # Floor division print(18 // 4) # Remainder of the division print(18 % 4) # Raising to the power of 4 print(18 ** 4)
copy

Task

  • On the second line, compute the floor division of 234 by 32.
  • On the fifth line, determine the remainder when 356 is divided by 17.

Why are these operations helpful?

For instance, picture this scenario: You've got $50 and you want to buy as many cookie packs as possible, with each pack priced at $6. You're trying to figure out the max number of packs you can purchase and the change you'll receive. Using the operations above, you can solve this easily.

  • 50 // 6 gives 8, which means you can buy 8 packs;
  • 50 % 6 results in 2, indicating you'll have $2 left after buying 8 packs.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Nice work! Python provides several additional math operations, including:

  • // - floor division or integer division;
  • % - modulus or remainder after division;
  • ** - exponentiation or raising to a power.

It's important to note that you can't use the traditional ^ symbol for exponentiation in Python, as it yields a different result. The syntax for these operations mirrors that of basic arithmetic. For example, 18 // 4 results in 4, because we're taking the whole number from the division (the actual result being 4.5). 14 % 5 gives 4, because when we divide 14 by 5, the remainder is 4. 4 ** 3 results in 64, because 4 multiplied by itself three times equals 64.

12345678
# Default division print(18 / 4) # Floor division print(18 // 4) # Remainder of the division print(18 % 4) # Raising to the power of 4 print(18 ** 4)
copy

Task

  • On the second line, compute the floor division of 234 by 32.
  • On the fifth line, determine the remainder when 356 is divided by 17.

Why are these operations helpful?

For instance, picture this scenario: You've got $50 and you want to buy as many cookie packs as possible, with each pack priced at $6. You're trying to figure out the max number of packs you can purchase and the change you'll receive. Using the operations above, you can solve this easily.

  • 50 // 6 gives 8, which means you can buy 8 packs;
  • 50 % 6 results in 2, indicating you'll have $2 left after buying 8 packs.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Section 1. Chapter 4
Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
some-alt