The Python Oracle

Python inconsistent error when comparing two very large numbers

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Ocean Floor

--

Chapters
00:00 Question
02:27 Accepted answer (Score 7)
03:06 Thank you

--

Full question
https://stackoverflow.com/questions/4273...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python

#avk47



ACCEPTED ANSWER

Score 7


The issue is with your format calls. You're using {0} twice, which means you get the first positional argument repeated twice in the output text. The integer conversion of response is never printed.

To fix the reporting (not whatever issue is causing the mismatched data), you should either use {0} and {1} once each, or leave out the numbers completely (Python will automatically use {0} for the first {} and {1} for the second, etc.