@[email protected] to Lemmy [email protected]English • 8 months agoI wishi.imgur.commessage-square185fedilinkarrow-up1906
arrow-up1888imageI wishi.imgur.com@[email protected] to Lemmy [email protected]English • 8 months agomessage-square185fedilink
minus-squareenkerslinkfedilink42•edit-28 months agoThis is your brain on python: def is_even (num): return num in [x*2 for x in range(sys.maxsize / 2)]
minus-squareGoddard Guryonlinkfedilink10•8 months agoThat won’t work tho, you need to make it sys.maxsize//2 to coerce the output into int form
minus-squareGoddard Guryonlinkfedilink1•8 months agoIIRC it doesn’t; that has caused me pain so many times when trying to generate fractional range
This is your brain on python:
That won’t work tho, you need to make it sys.maxsize//2 to coerce the output into int form
range()
accepts floats, does it not?IIRC it doesn’t; that has caused me pain so many times when trying to generate fractional range