r/Python • • Jun 28 '15

Python function to check if someone has a `life` or not

Post image
0 Upvotes

7 comments sorted by

17

u/[deleted] Jun 28 '15

That really should be

 def has_a_life(outside_activities):
     return outside_activities > 2

1

u/TheBlackCat13 Jun 28 '15

I thought the same thing. Which may be part of the joke.

1

u/cghio Jun 29 '15

All my Haskell programming has made me want to write

has_a_life = 2..__lt__

I'm not not ashamed.

0

u/Oni_Kami Jun 28 '15
print(has_a_life(Oni_Kami))

False

1

u/[deleted] Jun 29 '15

TypeError: expected a list, not a string