Siamese Twins

Write a function called both() that will receive two lists and return a new list containing only the values that appear in both lists. It does not matter what order the values are in.

Examples:

Also use the randlist() function you wrote in a previous assignment to test your function:

Bonus

For +10 bonus points, only use one loop. Also make sure your code still works even if the lists are different lengths.




©2017 Graham Mitchell