I have two lists.
e_list = [('edward', '1.2.3.4.'), ('jane','1.2.3.4.'), ('jackie', '2.3.4.10.')...]
and a_list (the main list to be checked against)
a_list = [('a', '1.2.3.'), ('b', '2.3.'), ('c', '2.3.4.')...]
I'd like a modified output to my original question. I'm unsure of how I'd change the code snippet to solve the same question but to output all possibilities?
e.g.
new_list = [ ('edward', '1.2.3.4', '1.2.3'), ('jane', '1.2.3.4.', '1.2.3'), ('jackie', '2.3.4.10.', '2.3.'), ('jackie', '2.3.4.10.', '2.3.4')]
解决方案
You can use list comprehension if you want:
res = [(name, digits, match) for name, digits in e_