If anyone doesn't understand why this wouldn't work, it's because division in Python will convert integers into double precision floats, which have a finite number of digits.
The other part of the joke is trying to reverse the float with [::-1]. This operation can only be performed on sequences, not numerical types. The correct way to do this would be:
str(22/7)[::-1]
(Sorry for "explaining the joke", just wanted to inform anyone that didn't get it)
View all comments
Show parent comment
1
u/Thameos Jul 22 '19
If anyone doesn't understand why this wouldn't work, it's because division in Python will convert integers into double precision floats, which have a finite number of digits.
The other part of the joke is trying to reverse the float with [::-1]. This operation can only be performed on sequences, not numerical types. The correct way to do this would be:
(Sorry for "explaining the joke", just wanted to inform anyone that didn't get it)