Add Python code for happy numbers.