Kodewick
Start learning →
Starter←→0 / 100

Roll call

#092StarterListsLoops3 min

The teacher takes the register. names is the whole class and here is who came today. Write absent(names, here) to return who is missing, in register order; if everyone came, return an empty list [].

Examples
absent(["Ann", "Bo", "Cai", "Dee"], ["Bo", "Dee"])→['Ann', 'Cai']
absent(["Ann", "Bo"], ["Bo", "Ann"])→[]
main.py
def absent(names, here):
    missing = []
    for name in names:
        # your code here: if name is not in here, put it in missing
        pass
    return missing
Ctrl + Enter runs too
Result

Run tries the examples. When they look right, Submit.