[Python] ZyBooks 5.18.1 Unit test troubles

Discussão em 'Python' iniciado por Stack, Abril 5, 2025.

  1. Stack

    Stack Membro Participativo

    I'm attempting to do the ZyBooks Swapping Values Lab, and I've hit a bit of a snag. Here's the code I have as of now.

    ''' Define your function here. '''
    def swap_values(user_val1, user_val2):
    print (user_val2, user_val1)

    if __name__ == '__main__':
    ''' Type your code here. Your code must call the function. '''

    user_val1 = int(input())
    user_val2 = int(input())

    swap_values(user_val1, user_val2)


    I have the compare output test nailed, but I have absolutely no clue how to get it to pass the Unit tests. The three sets of input for these tests are swap_values(-1, 10), swap_values(9, 0), and swap_values(11, 11). I've input all of these, and they work with the function, but the unit tests all say "Your test produced no output.". I can't tell if it means those inputs aren't supposed to be output, or if the auto-grading isn't seeing those inputs. What exactly do I need to do here?

    Continue reading...

Compartilhe esta Página