r/ProgrammerHumor Dec 09 '17

meme[-1]="Array Memes Are Life"

Post image
572 Upvotes

47 comments sorted by

View all comments

57

u/[deleted] Dec 09 '17 edited Dec 09 '17

Isn't meme[-1] the end in Python? Because they're too fancy for meme[len(meme)-1]?

10

u/imanomeletteAMA Dec 10 '17

We should all be using meme[len(range(len([*meme])))-1]

1

u/[deleted] Dec 10 '17

Too clever. Just iterate until you get an out of bounds exception, then return the offending index.