How to output ''toto_list'' items in ''father_list'' list input, as separate list
Solution 1:
print_tidy_list
needs to print or to return a list? return print(tidy_list)
will give you None
.
You should do like this, and take care of the printing activity outside the function:
def print_tidy_list(film_names):
toto_list = ['Toto XX', 'The Seventh One', 'Fahrenheit']
tidy_list = [x for x in film_names if x in toto_list]
return tidy_list
or you could print(tidy_list)
in the function (as the name would suggest) and do not return anything.