Question: Write python code for below question; Friendship among Numbers! Its easy to define friendship among humans but what if they are numbers? Lets give a
Write python code for below question;

Friendship among Numbers! Its easy to define friendship among humans but what if they are numbers? Lets give a new definition of friendship among numbers: If the sum of proper divisor of one number is equal to the second number, then they are called as FRIENDS! Example, proper divisor of 220 are 1, 2, 4, 5, 10, 11, 20, 22, 44, 55 and 110, of which the sum is 284; and the proper divisors of 284 are 1, 2, 4, 71 and 142, of which the sum is 220. Thus 220 and 284 are FRIENDS. Write a program that takes list of numbers and print the pair of friendly numbers and also how many such pairs are ther in the list (count). Input: (n, list[]) 6 220 284 1184 1210 2 5 Output: 220 284 1184 1210 Total Pairs 2 Input: 3 239 334 121 Output: Total Pairs 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
