for example: my command line after execution of a program has to be like this:
perfect(44) #using the defined function in the output screen.(44) or any other number
and the output should be:
false
this the code i have tried but in this i cannot use the funcion in the command line.
def factors(n):
factorlist = []
for i in range(1,n):
if n%i == 0:
factorlist = factorlist + [i]
print factorlist
return factorlist
def perfect(n):
factorlist = factors(n)
if sum(factorlist) == n:
return True
else :
return False
n = int(raw_input())
print(perfect(n))