Multiply and Divide without ‘*’ & ‘ / ‘ in Python

#---------------------------- multiply without ' * '  ------------------------------------

num1 =int(input("enter 1st number :"))
num2 =int(input("enter 2nd number :"))

sum =0 
for i in range(num2,0,-1):
    sum+=num1
print(num1,"*",num2,"=",sum)
#----------------------------  divide without - '/ '  ------------------------------------

num1 =int(input("enter 1st number :"))
num2 =int(input("enter 2nd number :"))
count =0
sub =num1

while(sub>0):
    sub -= num2
    count+=1
if(num1 % num2 == 0):
     print(num1,"/",num2,"=",count) # returns count if is exactly divisible
else:
    print(num1,"/",num2,"=",count-1) # returns count-1 if is not exactly divisible

Join our team, where career growth knows no limits.

For More Details

Our internship program guarantees personalized attention for optimal career development in the tech industry.

+91 97879 68375

-> You should bring your own laptop during the internship

Who can apply?

Internships are open for students who: B.E / B.Tech / M.E / M.Tech / B.Sc / M.Sc / M.C.A / B.C.A / Diploma.

  • Ongoing Students Only
  • days, 5days/ 10days or Based on Student Preference
  • Limited 1 to 10 students per slot
  • Registration fees : 1000 INR
  • Slots are filling quickly only fewer slots are available