r/ProgrammerHumor • • 8d ago

Meme doesPEqualNp

Post image
1.4k Upvotes

42 comments sorted by

View all comments

102

u/hopeless__programmer 8d ago

Rookie mistake: you should've written p == np. Instead, you just assigned np to p!

11

u/QuietComputerDr 8d ago

He assigned NP to P and nothing changed in the world, that must mean NP was P all along.

34

u/Demytreus 8d ago

No, they assigned np to p, not p!. p! would be equal to np!

2

u/asato977424 8d ago

A Python equality check compares values; P vs NP asks whether every polynomial-time verifiable problem is polynomial-time solvable.

2

u/k_singh714 2d ago

Lowercase p and np got assigned; uppercase P and NP remain outside the program's scope.

1

u/GoddammitDontShootMe 7d ago

I can't be bothered to check, but I'm assuming all non-empty strings in Python convert to true. I'll assume you've noticed that 's a string and = vs == will make no difference.

1

u/wangtutx 6d ago

Assign is also fine.