Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
AncientAustereArchitect created by acwoss - https://repl.it/@acwoss/AncientAustereArchitect
def multiply(a, b):
result = sum(b for _ in range(abs(a)))
return result if a > 0 else -result
print(multiply(2, 5))
print(multiply(-2, -5))
print(multiply(-2, 5))
print(multiply(2, -5))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.