Skip to content

cs50/problems/2022/python/working: check50 doesn’t reject single-digit minutes (e.g., "10:7 AM to 5 PM") #388

@kali-mx

Description

@kali-mx

Summary

Raising this to help improve the autograder tests for future students.

For cs50/problems/2022/python/working, check50 currently accepts an implementation of convert that allows single-digit minutes (e.g., "10:7 AM to 5 PM"), even though the spec states that minutes must be exactly two digits when provided in HH:MM form.


Minimal example / behavior

My current implementation passes all check50 tests:

$ check50 cs50/problems/2022/python/working
# ... all tests reported as passing ...

The program accepts an input with single-digit minutes (10:7 AM).

It does not raise ValueError.

It simply prints 10:7 to 17:00.

Given that this implementation passes check50, it appears that there is no test that verifies the requirement that minutes be two digits when present.

Expected vs actual behavior

Expected (per spec):

Inputs like "10:7 AM to 5 PM" should be considered invalid and cause convert to raise ValueError, because minutes in HH:MM must be two digits.

Actual:

An implementation that accepts "10:7 AM to 5 PM" and outputs "10:7 to 17:00" still passes check50 cs50/problems/2022/python/working.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    CS50PCS50 Python

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions