I'm trying to solve a Happy number algorithm problem
Look at my code:
def isHappy(self, n):
nums = str(n)
result = 0
for num in nums:
result += int(num) * int(num)
nums = str(result)
if (nums == '1'): print("True")
on the off chance that the total number of 1 is seven in the input, it has a mistake. like ["1111111, 10111111", "11101111", "11011111"]
these numbers must be True yet results are False.
I know it needs to rehash one more while loop however every time I attempt to fix my code, I got more errors...
I don't do not understand how to fix this code. could you give me a clue?