Horje
perfect numbers python Code Example
perfect number in python
def perfect_number(n):
    sum = 0
    for x in range(1, n):
        if n % x == 0:
            sum += x
    return sum == n
print(perfect_number(6))
perfect numbers python
n=int(input("Enter a Number : "))
c = 0
for i in range(1, n):
    if n % i == 0:
        c = c + i
if c == n:
    print(n, "The number is a Perfect number!")
else:
    print(n, "The number is not a Perfect number!")
perfect number program in python
n = int(input("Enter any number: "))sum1 = 0for i in range(1, n):if(n % i == 0):sum1 = sum1 + iif (sum1 == n):print("The number is a Perfect number!")else:print("The number is not a Perfect number!")
python num perfect squares
print(int(int(n)**.5))




Python

Related
error popup in django not visible Code Example error popup in django not visible Code Example
how to leave some parameters in python and let the value be anything Code Example how to leave some parameters in python and let the value be anything Code Example
how to export data from mongodb python Code Example how to export data from mongodb python Code Example
how to create data dictionary in python using keys and values Code Example how to create data dictionary in python using keys and values Code Example
print specific part in bold or colours and end. Code Example print specific part in bold or colours and end. Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8