Skip to content

CS50P Problem Set 4, Little Professor error in checking, possibly related to random.seed() #318

Open
@SimonJagerSwe

Description

@SimonJagerSwe

I have been working on this problem for a while, and I have managed to make a functioning program, but I fail one of the checks when using check50 cs50/problems/2022/python/professor.

The check that fails is #6," Little Professor generates random numbers correctly". From what I've been able to see from the init.py file in this repo (https://github.com/cs50/problems/blob/2022/python/professor/__init__.py), the comments suggest that the test file uses random.seed(500), and expects the output [7, 8, 9, 7, 4, 6, 3, 1, 5, 9, 1, 0, 3, 5, 3, 6, 4, 0, 1, 5]. However, when this seed is applied, I get [9, 5, 8, 0, 2, 7, 9, 0, 3, 7, 5, 3, 5, 8, 0, 0, 7, 2, 9, 1] every time (this also happens when I use random.seed(500) in my own IDE, so it's not just the CS50 environment that has this issue.

Is there any way around this error, since I can't hard code the output to be what the test expects when the seed output and the seed expectation are different. This possibly ties in to the issue opened here (#217).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions