Skip to main content
5 votes

Why does my CS50P PSET4 Professor implementation fail check50?

I had the same problem. Issue is in this line of code: return random.randint(10 ** (n - 1), 10**n - 1) the feedback from check50 is that you failed 'At Level 1, Little Professor generates addition ...
sarah zaccagni's user avatar
3 votes

(Edited) CS50P - PSET 4 - LITTLE PROFESSOR

There is a requirement "hidden" in the How to Test section. Under the 3rd bullet it says (in part): Your program should output 10 distinct problems before printing... A review of your code ...
kcw78's user avatar
  • 922
1 vote
Accepted

Pset4 professor.py fails to pass one test with check50

Your get_level function is producing a ValueError when user enters a string that can't be converted to an integer by the int function def get_level(): # return 1, 2, or 3 levels = [1, 2, 3] ...
kbl's user avatar
  • 79
1 vote

Solved: Little Professor claims my program doesn't output a score in the end

Your code repeats the same problem after the player gets it wrong 3 times. It then counts that as a correct score. In this scenario, for example, after missing the 1+4= three times, it should give ...
curiouskiwi's user avatar
  • 18.7k
1 vote

Why does my CS50P PSET4 Professor implementation fail check50?

here is my one-liner, def generate_integer(level): return random.randint(10**(level -1)-int(level == 1), 10**level-1) using this boolean expression int(level == 1) if level = 1, it will be True, ...
aladinus's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible