How to multiply two numbers without using the multiple operator (*) in Python

1 Answer

0 votes
a = 3
b = 9
mul = 0
 
# mul = a * b 
 
for i in range(1, a + 1):
    mul = mul + b
 
print(a, " * ", b, " = ", mul)
 
 
 
'''
run:
 
3  *  9  =  27
 
'''

 



answered Mar 21, 2016 by avibootz
edited Apr 3, 2024 by avibootz
...