You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem description for PSET 5 Refueling has the following description:
The check50 validation fails at step 2 :( correct fuel.py passes all test_fuel checks If user attempts to add a test for the requirement the nearest int between 0 and 100, inclusive. :
defconvert(input: str) ->int:
# Will raise ValueError if int() conversion fails# Will raise ValueError if too many values to unpackdividend, divisor= (int(value) forvalueininput.split("/"))
ifdividend>divisor:
raiseValueError("Dividend can not be larger than divisor.")
result=round((dividend/divisor) *100)
ifresultnotinrange(0, 101):
raiseValueError("Result must be an int between 0 and 100, inclusive.")
returnresult
When the test is enabled:
When skipping the test:
The text was updated successfully, but these errors were encountered:
Preconditions
test_fuel.py
, which passes the check50 validation:Steps to reproduce:
test_fuel.py
:check50 cs50/problems/2022/python/tests/fuel
Expected result
Actual result
The problem description for PSET 5 Refueling has the following description:
The check50 validation fails at step 2
:( correct fuel.py passes all test_fuel checks
If user attempts to add a test for the requirementthe nearest int between 0 and 100, inclusive.
:When the test is enabled:
When skipping the test:
The text was updated successfully, but these errors were encountered: