Answers for "finding amicable numbers with python"

0

finding amicable numbers with python

x=int(input('Enter number 1: '))
y=int(input('Enter number 2: '))
sum1=0
sum2=0
for i in range(1,x):
    if x%i==0:
        sum1+=i
for j in range(1,y):
    if y%j==0:
        sum2+=j
if(sum1==y and sum2==x):
    print('Amicable!')
else:
    print('Not Amicable!')
Posted by: Guest on May-07-2021

Code answers related to "finding amicable numbers with python"

Python Answers by Framework

Browse Popular Code Answers by Language