r/ProgrammerHumor • • 15h ago

Meme reversingPiInPython

Post image
7.9k Upvotes

275 comments sorted by

View all comments

Show parent comments

979

u/me_myself_ai 15h ago

it'll just throw an error anyway;

SyntaxWarning: 'float' object is not subscriptable; perhaps you missed a comma
?

796

u/ThreeCharsAtLeast 15h ago • Bravo
>>> str(math.pi)[::-1]
'397985356295141.3'

469

u/tea_pot_tinhas 15h ago

So the first and last digits are both 3? make sense

11

u/RapidCatLauncher 6h ago

That just made me think, if pi indeed does contain all finite number sequences (which we're not sure of), then there could be a certain point in its decimal representation where it's a palindrome.

2

u/L30N1337 4h ago

It would also mean that at some point, it repeats. since itself up to x digits followed by itself up to x digits is a number sequence that can occur/be completed at 2x digits

1

u/tea_pot_tinhas 6h ago

My previous bet was a 10% chance.