Skip to content

Default variable

you will work with the script exo_02.py in the package exos. The script already exists with the following code:

def add_knight(knight:str, kingdom:list=[]):
    kingdom.append(knight)
    return kingdom

Test the function and find what may (maybe) not work.

In such situation, what would you suggest ?

Try working with tests…