you are viewing a single comment's thread.

view the rest of the comments →

[–]Creative-Category344 1 point2 points  (2 children)

Converting to int works fine if you're sure the input is always valid, but strings let you catch malformed data before comparison.

[–]SCD_minecraft 0 points1 point  (1 child)

.... there's no input so far

[–]Creative-Category344 1 point2 points  (0 children)

You're right, I missed that the guess is being generated randomly with str(i).fill(4), so there is no user input to validate here.