Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = 1
- while True:
- lst = [int(i) for i in str(n)]
- lst2 = [int(i) for i in str(n**2)]
- if sum(lst) == sum(lst2):
- print "winner"
- print n
- print n**2
- print "Sum:", sum(lst), sum(lst2)
- print ""
- n += 1
- else:
- n += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement