 <pre><code>data = [('turtle', 'sock'), ('frog', 'hat'), ('turtle', 'shirt'), ('frog', 'boot')] def function(key): listWithKey = [] for element in data: if element[0] == key: listWithKey.append(element[1]) return listWithKey print(function("turtle")) </code></pre> <p>This is a more basic approach just using lists and loops. The output is <code>['sock', 'shirt']</code></p>