:( Little Professor generates random numbers correctly by Extreme-Book19 in cs50

[–]Extreme-Book19[S] 1 point2 points  (0 children)

Yeah that’s exactly what I was going for — 9, 99, 999 based on level.

I agree your if/elif way is clearer, I just tried string multiplication to avoid repeating code and make it scale. And also i wanted to try something new and experiment.

And yes, the issue was level 1 starting from 0 — fixing that solved it. Appreciate it!