I have 2 lists of strings and I want to compare and return the strings that have the same length in the same position in each of the string lists. I understand how to do this with loops and comprehensions so I've been trying to do this using zip, lambdas, and filter which I want to practice more but have been running into a wall after endless searching/googling.
list1 = ["aaa", "bb", "c", "wwwww"]
list2 = ["dddd", "xx", "a", "abcd"]
Should return: [("bb", "xx"), ("c", "a")]
Heres what I've been using but doesnt seem to be working:
list(filter(lambda param: len(param) == len(param), zip(list1, list2)))