Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Multiplication | Numeric Types
Python Data Types

bookMultiplication

To multiply numbers we will use operator *. We can multiply numbers with each other of any numeric type.

Input:
num_1 = 25 + 8j
num_2 = 3
multiplication = num_1 * num_2

print(f'The multiplication of {num_1} and {num_2} is {multiplication}')

Output:
The multiplication of (25+8j) and 3 is (75+24j)
Input:
num_1 = 13.6
num_2 = 3.5
multiplication = num_1*num_2

print(f'The multiplication of {num_1} and {num_2} is {multiplication}')

Output:
The multiplication of 13.6 and 3.5 is 47.6
Input:
num_1 = 4
num_2 = 3.2
multiplication = num_1*num_2

print(f'The multiplication of {num_1} and {num_2} is {multiplication}')

Output:
The multiplication of 4 and 3.2 is 12.8
Opgave

Swipe to start coding

You have 2 complex numbers, multiply them.

Løsning

Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 1. Kapitel 8
single

single

Spørg AI

expand

Spørg AI

ChatGPT

Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat

Suggested prompts:

Opsummér dette kapitel

Explain code

Explain why doesn't solve task

close

Awesome!

Completion rate improved to 3.85

bookMultiplication

Stryg for at vise menuen

To multiply numbers we will use operator *. We can multiply numbers with each other of any numeric type.

Input:
num_1 = 25 + 8j
num_2 = 3
multiplication = num_1 * num_2

print(f'The multiplication of {num_1} and {num_2} is {multiplication}')

Output:
The multiplication of (25+8j) and 3 is (75+24j)
Input:
num_1 = 13.6
num_2 = 3.5
multiplication = num_1*num_2

print(f'The multiplication of {num_1} and {num_2} is {multiplication}')

Output:
The multiplication of 13.6 and 3.5 is 47.6
Input:
num_1 = 4
num_2 = 3.2
multiplication = num_1*num_2

print(f'The multiplication of {num_1} and {num_2} is {multiplication}')

Output:
The multiplication of 4 and 3.2 is 12.8
Opgave

Swipe to start coding

You have 2 complex numbers, multiply them.

Løsning

Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 1. Kapitel 8
single

single

some-alt