problems
problems copied to clipboard
Checks for check50
My initially incorrect code passed check50 with this: ``` // TODO: Randomly assign current person's alleles based on the alleles of their parents aperson->alleles[0] = parent0->alleles[rand() % 2]; aperson->alleles[1] =...
## Preconditions 1. Have a `test_fuel.py`, which passes the check50 validation: ```python import pytest from fuel import convert, gauge @pytest.mark.parametrize( "input, expected", [ ("3/4", 75), ], ) def test_convert(input, expected):...
## Preconditions 1. Have a `taqueria.py`, which prints "Total: ..." when user enters item not in the menu: ```python CONST_USER_PROMPT = "Item: " CONST_MENU = { "Baja Taco": 4.25, "Burrito":...
## Preconditions 1. Have a `game.py`, which allows negative guesses from user: ```python import random from typing import Sequence CONST_USER_PROMPT_LEVEL = "Level: " CONST_USER_PROMPT_GUESS = "Guess: " CONST_GUESS_TOO_SMALL = "Too...
The assignment for Game stipulates that the program should reject "non-positive" guesses, but the only "non-positive" guess check50 tests for is 0 - not any negative numbers. This allows a...
The error: When a student declares a test for a case with the correct number of digits but disallowing leading zeroes, e.g. by not allowing `025`, check50 says the correct...
check50 for doesn't handle 4 digit numbers in IPv4 addresses. This version of `test_numb3rs.py` results in an error message ``` def test_IPrange(): assert validate(r'255.255.255.255') == True assert validate(r'1.1.1.1000') == False...
I'm working on the `lines.py` problem in CS50P, and I encountered an issue with the `check50` tests. When I include logic to skip docstrings (lines starting with `"""` or `'''`),...
## CS50x Tideman - Correct `sort_pairs` algorithm fails ### Problem: - Student attempts to calculate pair strengths by iterating through `preferences` in the same order that they would have generated...