You're viewing a single thread.
All Comments
183 comments
enkers @sh.itjust.works This is your brain on python:
def is_even (num): return num in [x*2 for x in range(sys.maxsize / 2)]
42 0 ReplyGoddard Guryon @sopuli.xyz
That won't work tho, you need to make it sys.maxsize//2 to coerce the output into int form
10 0 Replyrobotica @lemmy.world range()
accepts floats, does it not?4 0 ReplyGoddard Guryon @sopuli.xyz
IIRC it doesn't; that has caused me pain so many times when trying to generate fractional range
1 0 Reply
183 comments
Scroll to top