Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def print_table(n):
- for x in range(1,n+1):
- tot = 0
- for y in range(1,x):
- if x%y == 0:
- tot+=y
- if x == 1:
- print x, 'is perfect'
- elif tot < x:
- print x, 'is deficient'
- elif tot == x:
- print x, 'is perfect'
- elif tot > x:
- print x, 'is abundant'
- number = int(raw_input("Enter a number: "))
- print_table(number)
Add Comment
Please, Sign In to add comment