Multiply Two Numbers

Write a function multiply that takes two numbers a and b and returns their product. The numbers can be positive, negative, or equal to 0. The * operator will help with multiplication.

Примеры

Ввод
2, 3
Вывод
6
Ввод
5, 0
Вывод
0
Ввод
-4, 3
Вывод
-12

Нужно реализовать

def multiply(a: int, b: int) -> int:

Теги

math
PostgreSQLv16

Ovdje će se prikazati rezultat izvršavanja koda

Tests12
Visible tests
Skriveni test 7
Skriveni test 8
Skriveni test 9
Skriveni test 10
Skriveni test 11
Skriveni test 12

They run when you press "Submit" — your whole solution is checked against them so you can't hard-code answers for the visible cases.

Focus radio
Paused · SomaFM · Fluid