Nielsen Interview Question

check if happy number in python?