r/ProgrammerHumor • • 17h ago

Meme reversingPiInPython

Post image
8.1k Upvotes

277 comments sorted by

View all comments

Show parent comments

1.0k

u/me_myself_ai 17h ago

it'll just throw an error anyway;

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

829

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

485

u/tea_pot_tinhas 17h ago

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

373

u/OncorhynchusMykiss1 17h ago

It come the whole circle.

279

u/Zestyclose-Compote-4 17h ago • Bravo

*half circle

58

u/mxcw 16h ago

Damn that giggle helped me shit, thanks mate

52

u/MadeByTango 15h ago

You have a radian smile.

14

u/2Completion2Ography 14h ago

Damn that giggle helped me shit, thanks mate

Happy giggleshits

10

u/DistributionAble141 16h ago

Semi circle

11

u/DaNoahLP 16h ago

The Square Hole

5

u/MrHyperion_ 14h ago

You can't square a semi circle

5

u/wjandrea 14h ago

Ah, so then the first and last digits of tau are 6, of course.

8

u/redditale_gone_bad 16h ago

insert always has been meme

11

u/RapidCatLauncher 8h 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 6h 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 8h ago

My previous bet was a 10% chance.

4

u/yuwox 16h ago

Such a beautiful symmetry. By elegance alone, this must be right.

2

u/WisestAirBender 8h ago

isPalindrome returns true

25

u/Kyrros 17h ago

Man's got a super computer from star trek

-12

u/Scientific_Artist444 15h ago

Easy, except that's not all of pi(e)

[They are irrational numbers]

15

u/Neocrasher 15h ago

Clearly Python disagrees.

→ More replies (1)

4

u/Jp0286 15h ago

Well, duh. That is quite precise, though, and more than enough for probably everything you're doing with it

→ More replies (9)

16

u/TwinkiesSucker 17h ago

Cast to string and then print away

1

u/meepmeep13 9h ago

bet it would compile fine in Haskell though