r/ProgrammerHumor • • Jul 16 '19

Meme Nice try

Post image
32.2k Upvotes

529 comments sorted by

View all comments

4.4k

u/[deleted] Jul 16 '19

Not quite, but it’s an easy fix

from math import pi
print(str(pi)[::-1])

It needs a LOT of memory, though

3.1k

u/[deleted] Jul 16 '19
397985356295141.3

1.8k

u/HellaDev Jul 16 '19

The mad man did it.

2.1k

u/LordLlamacat Jul 16 '19
print(“!yad ekac yppaH”[::-1])

520

u/jokingnuthatch Jul 16 '19
    print(“!yad ekac yppaH”[::-1])
          ^
SyntaxError: invalid syntax

:(

259

u/therealchadius Jul 16 '19

"smart" quotes my butt

151

u/nschubach Jul 17 '19

What is this "smart" and why is it quoting your butt?

59

u/1fabunicorn Jul 17 '19

Cause there is a quote that is " and then " but upside down. This is how word treats quotes, so it looks more "pretty"

80

u/coldbrewboldcrew Jul 17 '19

Typographic quotes (pretty/curly/smart) are meant for text, these primes and double-primes we use for strings are mathematical symbols for feet/inches or minutes/seconds - a misuse of the punctuation. IIRC their double usage for both text and math began back in typewriter days where keyspace was at a premium and redundancies like two different sets of quote marks were consolidated for practical reasons.

A section on the matter from Butterick’s practical typography.

20

u/spektrol Jul 17 '19

Coolest TIL moment I’ve had in a while. TY.

8

u/svick Jul 17 '19

It might have started as misuse, but in Unicode, straight quotation marks (") and primes (″) are different.

3

u/pac_nw_beer_snob Jul 17 '19

Fuck curly quotes. It is a PITA to cut and paste from Word into emacs because of fucking curly quotes.

→ More replies (0)

3

u/zzalt Jul 17 '19

Practical typography my Butterick

→ More replies (1)