In this artical we are going to discuss python program to multiply two numbers by repeated addition. So lats start...

Python Program to multiply two numbers by repeated addition.

num1=int(input("Enter first number "))

num2=int(input("Enter second number "))

product=0

for i in range (1,num2+1): 

 product=product+num1      

print("The multiply is: ",product)

Output:          

           Enter first number 6
           Enter second number 7
           The multiply is:  42


Python Program to multiply two numbers by repeated addition using function.

def multiply(a,b):

    sum=0

    for i in range(b):

        sum=sum+a

    print("The multiply is: ",sum)

num1=int(input("Enter first number "))

num2= int(input("Enter second number "))

multiply(num1,num2)

 

Output:

           Enter first number 6
           Enter second number 7
           The multiply is:  42