A “While” Loop is used to repeat a block of code an unknown number of times until it meets a condition. The while statement allows you to iterate over a statement until a specified expression is false.

The difference between a for loop and a while loop is that in a for loop, the number of iterations to be performed is already known and is used to obtain a specific result, whereas in a while loop, the command runs until a specific condition is met and the statement is proven false.

```
Num = int(input("Enter The Number"))
Sum = 0
for i in range(1, Num):
if(Num % i == 0):
Sum = Sum + i
if (Sum == Num):
print("It is a Perfect Number")
else:
print("It is Not a Perfect Number")
```

Output:

Enter The Number 45

It is Not a Perfect Number

Python Program to Check Palindrome Number Using Functions

Python Program to Find Armstrong Number in an Interval Using While Loop

Python Program to Find GCD of Two Numbers Using While Loop

Python Program to Check Prime Number Using If Else

C++ Program for Fibonacci Series Using Recursion

GCD Program in Java Using Recursion

Addition of Two Numbers in C# Using Class

How to Add Multiple Values to String in C#