Pyscript Multiplication Challenge

Challenge Description

Define a function multiply(a: int, b: int) -> int that returns the product of a and b, without using built-in multiplication operators.

Rules

  1. You may not install or use any dependencies.
  2. You may not use the * or *= operators.
  3. The challenge will run your implementation using python 3.13.2.

Examples:

  • multiply(2, 3) should return 6
  • multiply(-1, 2) should return -2
  • multiply(3, 0) should return 0

When you run your code, it will run in your browser!

You can view the challenge source code on GitHub.

Workspace

Output