Skip to main content
Bumped by Community user
added 1027 characters in body
Source Link

in professor problem-set-4 i write the code completly right and my app runs without any problem but check50 gives an error to my code like: can't check until a frown turns upside down but my app provide all the specifications in pset. i didnt share my code because it makes an spoil to the pset but i can send to any staff member of cs50

:) professor.py exists
:) Little Professor rejects level of 0
:) Little Professor rejects level of 4
:) Little Professor rejects level of one
:) Little Professor accepts valid level
:( At Level 1, Little Professor generates addition problems using 0–9
    Did not find "6 + 6 =" in "Level: 7 + 7 =..."
:) At Level 2, Little Professor generates addition problems using 10–99
:) At Level 3, Little Professor generates addition problems using 100–999
:| Little Professor generates 10 problems before exiting
    can't check until a frown turns upside down
:| Little Professor displays number of problems correct
    can't check until a frown turns upside down
:| Little Professor displays EEE when answer is incorrect
    can't check until a frown turns upside down
:| Little Professor shows solution after 3 incorrect attempts
    can't check until a frown turns upside down
To see the results in your browser go to https://submit.cs50.io/check50/2d3fe7692e7f5029b7e891faf1925bfb47920364
professor/ $ ```

in professor problem-set-4 i write the code completly right and my app runs without any problem but check50 gives an error to my code like: can't check until a frown turns upside down but my app provide all the specifications in pset. i didnt share my code because it makes an spoil to the pset but i can send to any staff member of cs50

in professor problem-set-4 i write the code completly right and my app runs without any problem but check50 gives an error to my code like: can't check until a frown turns upside down but my app provide all the specifications in pset. i didnt share my code because it makes an spoil to the pset but i can send to any staff member of cs50

:) professor.py exists
:) Little Professor rejects level of 0
:) Little Professor rejects level of 4
:) Little Professor rejects level of one
:) Little Professor accepts valid level
:( At Level 1, Little Professor generates addition problems using 0–9
    Did not find "6 + 6 =" in "Level: 7 + 7 =..."
:) At Level 2, Little Professor generates addition problems using 10–99
:) At Level 3, Little Professor generates addition problems using 100–999
:| Little Professor generates 10 problems before exiting
    can't check until a frown turns upside down
:| Little Professor displays number of problems correct
    can't check until a frown turns upside down
:| Little Professor displays EEE when answer is incorrect
    can't check until a frown turns upside down
:| Little Professor shows solution after 3 incorrect attempts
    can't check until a frown turns upside down
To see the results in your browser go to https://submit.cs50.io/check50/2d3fe7692e7f5029b7e891faf1925bfb47920364
professor/ $ ```
deleted 1688 characters in body
Source Link


# in the main function with the help of other two function we need to design a game
# like the specification in problem set

def main():
    # first we take an input from user to know the level of the game
    level = get_level()

    # we need to ask 10 problem from user and at the end we need to return that score
    # user only can answer wrong 3 times after than that he losts the point but he can see the answer
    score = 0
    round = 10
    while round > 0:
        # based on the level we generate the numbers
        first_number = generate_integer(level)
        last_number = generate_integer(level)
        sum1 = first_number + last_number
        wrong = 3
        while wrong > 0:
            try:
                sum2 = int(input(f'{first_number} + {last_number} = '))
                if sum2 == sum1:
                    round -= 1
                    score += 1
                    break
                else:
                    print('EEE')
                    wrong -= 1
                if wrong == 0:
                    round -= 1
                    print(f"{first_number} + {last_number} = {sum1}")
            except ValueError:
                pass


    # now we can print the score
    print(f'your score is: {score}')





# this function takes an integer from user

def get_level():
    while True:
        try:
            level = int(input('Level: '))
            if level == 1 or level == 2 or level == 3:
                return level
        except ValueError:
            pass


# this function based on the level we want generates the random numbers

def generate_integer(level):
    range_start = 10**(level-1)
    range_end = (10**level)-1
    return random.randint(range_start, range_end)


if __name__ == "__main__":
    main()

this is my code toin professor problem-set-4 professor my app copiles and runsi write the code completly okright and it providesmy app runs without any problem but check50 gives an error to my code like: can't check until a frown turns upside down but my app provide all the specifications butin pset. i didnt share my code because it makes an spoil to the pset but i dont know why check50 isnt working okcan send to any staff member of cs50


# in the main function with the help of other two function we need to design a game
# like the specification in problem set

def main():
    # first we take an input from user to know the level of the game
    level = get_level()

    # we need to ask 10 problem from user and at the end we need to return that score
    # user only can answer wrong 3 times after than that he losts the point but he can see the answer
    score = 0
    round = 10
    while round > 0:
        # based on the level we generate the numbers
        first_number = generate_integer(level)
        last_number = generate_integer(level)
        sum1 = first_number + last_number
        wrong = 3
        while wrong > 0:
            try:
                sum2 = int(input(f'{first_number} + {last_number} = '))
                if sum2 == sum1:
                    round -= 1
                    score += 1
                    break
                else:
                    print('EEE')
                    wrong -= 1
                if wrong == 0:
                    round -= 1
                    print(f"{first_number} + {last_number} = {sum1}")
            except ValueError:
                pass


    # now we can print the score
    print(f'your score is: {score}')





# this function takes an integer from user

def get_level():
    while True:
        try:
            level = int(input('Level: '))
            if level == 1 or level == 2 or level == 3:
                return level
        except ValueError:
            pass


# this function based on the level we want generates the random numbers

def generate_integer(level):
    range_start = 10**(level-1)
    range_end = (10**level)-1
    return random.randint(range_start, range_end)


if __name__ == "__main__":
    main()

this is my code to problem-set-4 professor my app copiles and runs completly ok and it provides all the specifications but i dont know why check50 isnt working ok

in professor problem-set-4 i write the code completly right and my app runs without any problem but check50 gives an error to my code like: can't check until a frown turns upside down but my app provide all the specifications in pset. i didnt share my code because it makes an spoil to the pset but i can send to any staff member of cs50

Source Link

cs50p professor (can't check until a frown turns upside down)


# in the main function with the help of other two function we need to design a game
# like the specification in problem set

def main():
    # first we take an input from user to know the level of the game
    level = get_level()

    # we need to ask 10 problem from user and at the end we need to return that score
    # user only can answer wrong 3 times after than that he losts the point but he can see the answer
    score = 0
    round = 10
    while round > 0:
        # based on the level we generate the numbers
        first_number = generate_integer(level)
        last_number = generate_integer(level)
        sum1 = first_number + last_number
        wrong = 3
        while wrong > 0:
            try:
                sum2 = int(input(f'{first_number} + {last_number} = '))
                if sum2 == sum1:
                    round -= 1
                    score += 1
                    break
                else:
                    print('EEE')
                    wrong -= 1
                if wrong == 0:
                    round -= 1
                    print(f"{first_number} + {last_number} = {sum1}")
            except ValueError:
                pass


    # now we can print the score
    print(f'your score is: {score}')





# this function takes an integer from user

def get_level():
    while True:
        try:
            level = int(input('Level: '))
            if level == 1 or level == 2 or level == 3:
                return level
        except ValueError:
            pass


# this function based on the level we want generates the random numbers

def generate_integer(level):
    range_start = 10**(level-1)
    range_end = (10**level)-1
    return random.randint(range_start, range_end)


if __name__ == "__main__":
    main()

this is my code to problem-set-4 professor my app copiles and runs completly ok and it provides all the specifications but i dont know why check50 isnt working ok