import re import pandas as pd def list_comprehension(l1: list): """For input list l1 of integers, return list of elements whose square is less than sum of all elements""" return None def nested_list_comprehension(l1: list, l2: list): """For input lists l1, l2, return a list of elements common to both l1 and l2.""" return None def dict_comprehension(l1: list): """For input list l1 of integers, return a dictionary with keys from l1, and values are squares of keys""" return None if __name__ == "__main__": l1 = [1, 2, 3, 4] l2 = [2, 4, 6, 8] print("\n-------------------\n") print("Inputs:\n") print(f"l1: {l1}") print(f"l2: {l2}") print("\n-------------------\n") print("list_comprehension:\n") print(f"Desired output: [2, 4]") print(f"Output : {list_comprehension(l2)}") print("\n-------------------\n") print("nested_list_comprehension:\n") print(f"Desired output: [2, 4]") print(f"Output : {nested_list_comprehension(l1, l2)}") print("\n-------------------\n") print("dict_comprehension:\n") print("Desired output: {1: 1, 2: 4, 3: 9, 4: 16}") print(f"Output: : {dict_comprehension(l1)}") print("\n-------------------\n")