maris@lemmy.world to Programmer Humor@programming.dev · 8 months agoGambling with Lainimagemessage-square27linkfedilinkarrow-up1338arrow-down111
arrow-up1327arrow-down1imageGambling with Lainmaris@lemmy.world to Programmer Humor@programming.dev · 8 months agomessage-square27linkfedilink
minus-squarer00ty@kbin.lifelinkfedilinkarrow-up3·8 months agoOh right. I thought it might work the same as range etc in python, where is does one less than you specify… Coming from, well every other language this really threw me off on my first python excursion.
minus-squareChaoticNeutralCzech@feddit.orglinkfedilinkEnglisharrow-up1·8 months agoAny language… except MATLAB. Fuck MATLAB. (Their arrays even start at 1, what the fuck?!)
minus-squareshape_warrior_t@programming.devlinkfedilinkEnglisharrow-up1·8 months agoYou can get the exclusive behaviour with random.randrange. (Relevant Stack Overflow question with a somewhat interesting answer)
Oh right. I thought it might work the same as range etc in python, where is does one less than you specify… Coming from, well every other language this really threw me off on my first python excursion.
Any language… except MATLAB. Fuck MATLAB.
(Their arrays even start at 1, what the fuck?!)
You can get the exclusive behaviour with
random.randrange. (Relevant Stack Overflow question with a somewhat interesting answer)