You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I accidentally discovered an issue with these 3 checks within the Little Professor problem in CS50P:
While using the random library in the generate_integer function, I mistakenly used randrange instead of randint and passed in (0, 9)(10, 99) and (100, 999) respectively.
Despite my error using randrange, all 3 checks for the integer ranges still passed. And failed on the next check, leading me to believe that there was an issue with my loops.
After I increased the upper limit within randrange or changed to randint on all 3 levels, I passed on all checks.
The text was updated successfully, but these errors were encountered:
Jayquon
changed the title
randrange(0, 9) usage doesn't fail check in Little Professor problem
CS50P | randrange(0, 9) usage doesn't fail check in Little Professor problem
Mar 17, 2024
Jayquon
changed the title
CS50P | randrange(0, 9) usage doesn't fail check in Little Professor problem
CS50P - Week 4 | randrange(0, 9) usage doesn't fail check in Little Professor problem
Mar 17, 2024
I accidentally discovered an issue with these 3 checks within the Little Professor problem in CS50P:
While using the random library in the
generate_integer
function, I mistakenly usedrandrange
instead ofrandint
and passed in(0, 9)
(10, 99)
and(100, 999)
respectively.Despite my error using
randrange
, all 3 checks for the integer ranges still passed. And failed on the next check, leading me to believe that there was an issue with my loops.After I increased the upper limit within
randrange
or changed torandint
on all 3 levels, I passed on all checks.Here is my full code snippet (fixed):
The text was updated successfully, but these errors were encountered: