I am trying to create a block that will take two lists and create a new list containing only variables that have appeared in both original lists, such as taking a list containing 1, 2, 3 and a list containing 2, 5, 7 and then creating a list containing only 2.
Does anybody know the easiest way to accomplish this?
Putting on my teacher hat: You are confused about the meaning of the word "variable." 1, 2, and 3 aren't variables; they're numbers. "Values," if you want a word that's not specific to numbers but also takes in other kinds of values such as lists, text strings, Booleans, and so on.
The list you want to produce and report is a subset of either of the two input lists. What procedure do you know that takes a list as input and reports a subset of the input list?