nave@lemmy.zip to Lemmy Shitpost@lemmy.worldEnglish · 11 months agoI wishi.imgur.comimagemessage-square188fedilinkarrow-up1915arrow-down116
arrow-up1899arrow-down1imageI wishi.imgur.comnave@lemmy.zip to Lemmy Shitpost@lemmy.worldEnglish · 11 months agomessage-square188fedilink
minus-squareenkers@sh.itjust.workslinkfedilinkarrow-up40·edit-211 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 Guryon@sopuli.xyzlinkfedilinkarrow-up10·11 months agoThat won’t work tho, you need to make it sys.maxsize//2 to coerce the output into int form
minus-squarerobotica@lemmy.worldlinkfedilinkarrow-up4·11 months agorange() accepts floats, does it not?
minus-squareGoddard Guryon@sopuli.xyzlinkfedilinkarrow-up1·11 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