PYTHON CORE · LESSON 04

Multiplication.

Think faster. · about 11 minutes

Learning with progressRead the summary for free. To save the work, log in to the account.
STEP 1

The star multiplies

When there are several similar groups, multiplication helps. In Python, his sign is an asterisk *.

2 * 3

✦ Two groups of three is a total of six.

STEP 2

Count by name.

You can save numbers under names and then multiply them. print will show you the answer.

bags = 2
balls = 3
print(bags * balls)

✦ There's a 6 on the screen.

IN-CLASS PRACTICE

Type the code yourself

Type an example manually. Don't confuse a star * with a + sign.

boxes = 2
toys = 4
print(boxes * toys)
Open the editor for class work
HOMEWORK

Solve it yourself

The price of price is 120, the number of count is 3. Save their product in total and output total.

The answer is hidden. Use similar examples from the lesson notes.

Opening up your homework