Multiplication
To multiply numbers we will use operator *. We can multiply numbers with each other of any numeric type.
pythonInput:num_1 = 25 + 8jnum_2 = 3multiplication = num_1 * num_2print(f'The multiplication of {num_1} and {num_2} is {multiplication}')Output:The multiplication of (25+8j) and 3 is (75+24j)
pythonInput:num_1 = 13.6num_2 = 3.5multiplication = num_1*num_2print(f'The multiplication of {num_1} and {num_2} is {multiplication}')Output:The multiplication of 13.6 and 3.5 is 47.6
pythonInput:num_1 = 4num_2 = 3.2multiplication = num_1*num_2print(f'The multiplication of {num_1} and {num_2} is {multiplication}')Output:The multiplication of 4 and 3.2 is 12.8
Tâche
Swipe to start coding
You have 2 complex numbers, multiply them.
Solution
a = 40.5 + 4j
b = 80.8 + 2j
multiplication = a * b
print(f'The multiplication of {a} and {b} is {multiplication}')
Tout était clair ?
Merci pour vos commentaires !
Section 1. Chapitre 8
a = 40.5 + 4j
b = 80.8 + 2j
multiplication = _ _ _
print(f'The multiplication of {a} and {b} is {_ _ _}')