Advertisement
SiberianPathfinder

Совершенное число

Apr 24th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.15 KB | None | 0 0
  1. def is_perfect(num):
  2.     s = [i for i in range(1, num // 2 + 1) if not num % i]
  3.     return sum(s) == n
  4.    
  5. print(is_perfect(497))
  6. print(is_perfect(496))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement