diff --git a/programs/Python/perfect_number.py b/programs/Python/perfect_number.py new file mode 100644 index 0000000..05e975e --- /dev/null +++ b/programs/Python/perfect_number.py @@ -0,0 +1,9 @@ +n=int(input("Enter a no. -")) +k=0 +for i in range(1,n): + if (n%i==0): + k=k+i +if(k==n): + print("This is a perfect number.") +else: + print("Not a perfect number")