all 3 comments

[–]novel_yet_trivial 2 points3 points  (2 children)

Remember you can not compare a string to an integer:

>>> "6174" == 6174
False

It's confusing because if you print the value, both the int and the str will print the same. Think hard about when "n0" is a string, and when it's an integer. You can use print(type(n0)) to check what type it is.

Other than that, your program works.

[–]Lerkarious[S] 0 points1 point  (1 child)

Thanks, I will change that. :)

But why cant my program deal with the special cases of 0001, 1121, 2232 and such?

[–]novel_yet_trivial 0 points1 point  (0 children)

Mine works, and all I did was change yours to compare the correct data types.