RulePersona3Reload@lemmy.blahaj.zone to 196@lemmy.blahaj.zone – 383 points – 4 days agolemmy.blahaj.zone56Post a CommentPreviewYou are viewing a single commentView all commentsreturn true is correct around half of the timeassert IsEven(2) == True assert IsEven(4) == True assert IsEven(6) == True All checks pass. LGTMreturn Math.random() > 0.5 would also be correct about half the timeWouldn't that only be correct about 25% of the time?for even, 50% chance of correctness, same for odd.
return true is correct around half of the timeassert IsEven(2) == True assert IsEven(4) == True assert IsEven(6) == True All checks pass. LGTMreturn Math.random() > 0.5 would also be correct about half the timeWouldn't that only be correct about 25% of the time?for even, 50% chance of correctness, same for odd.
return Math.random() > 0.5 would also be correct about half the timeWouldn't that only be correct about 25% of the time?for even, 50% chance of correctness, same for odd.
Wouldn't that only be correct about 25% of the time?for even, 50% chance of correctness, same for odd.
return true
is correct around half of the time
All checks pass. LGTM
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.