fork download
  1. #PF-Assgn-59
  2. def check_perfect_number(number):
  3. s=0
  4. for i in range(1,(x//2)+1):
  5. if(x%i==0):
  6. s+=i
  7. if(s==x):
  8. return True
  9. else:
  10. return False
  11.  
  12. def check_perfectno_from_list(no_list):
  13. perfectno_list=[]
  14. for i in no_list:
  15. if(check_perfect_number(i)):
  16. perfectno_list.append(i)
  17. return perfectno_list
  18.  
  19. perfectno_list=check_perfectno_from_list([18,6,4,2,1,28])
  20. print(perfectno_list)
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Traceback (most recent call last):
  File "/usr/lib/python3.5/py_compile.py", line 125, in compile
    _optimize=optimize)
  File "<frozen importlib._bootstrap_external>", line 735, in source_to_code
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "./prog.py", line 4
    for i in range(1,(x//2)+1):
                              ^
TabError: inconsistent use of tabs and spaces in indentation

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.5/py_compile.py", line 129, in compile
    raise py_exc
py_compile.PyCompileError: Sorry: TabError: inconsistent use of tabs and spaces in indentation (prog.py, line 4)
stdout
Standard output is empty