Python

#Perfect number.
n = int(input(“Enter any number: “))
s = 0
for i in range(1, n):
    if(n % i == 0):
        s = s + i
if (s == n):
    print(“The number is a Perfect number!”)
else:
    print(“The number is not a Perfect number!”)
#Squarroot of 36
import math
print(math.sqrt(36))
#Sum of digit
n = int(input(“Enter the number: “))
b=1
a=0
c=0
while(b != 0):
    c = n%10
    n = n//10
    a = a+c
    b = n
print(“sum=”,a)
#
Paste text,images,html and share with anyone
Scroll to Top