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 ...
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 ...
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]
...
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 ...
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, ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
professor × 4python × 2
cs50p × 2
pset4 × 1
check50 × 1
cs50-web-programming-with-python × 1
problemset4 × 1
cs50ppset4 × 1