@[email protected] to [email protected]English • 2 months agoRulelemmy.blahaj.zoneimagemessage-square57fedilinkarrow-up1386arrow-down16
arrow-up1380arrow-down1imageRulelemmy.blahaj.zone@[email protected] to [email protected]English • 2 months agomessage-square57fedilink
minus-square@[email protected]linkfedilinkEnglish77•2 months agoreturn true is correct around half of the time
minus-square@[email protected]linkfedilink41•2 months agoassert IsEven(2) == True assert IsEven(4) == True assert IsEven(6) == True All checks pass. LGTM
minus-square@aliserlink19•2 months agoreturn Math.random() > 0.5 would also be correct about half the time
minus-square@[email protected]linkfedilink1•2 months agoWouldn’t that only be correct about 25% of the time?
minus-squareRain World: Slugcat GamelinkEnglish0•2 months agofor even, 50% chance of correctness, same for odd.
return true
is correct around half of the time
assert IsEven(2) == True assert IsEven(4) == True assert IsEven(6) == True
All checks pass. LGTM
return Math.random() > 0.5
would also be correct about half the time
Wouldn’t that only be correct about 25% of the time?
for even, 50% chance of correctness, same for odd.