if you want to do this only by the use of pure python (no import), you can do it like this:
# arguments:
list_x = ['a', 'b', 'c', 'd']
list_y = ['1', '2', '3', '4']
# returns:
list_xy = [a+b for a in list_x for b in list_y]
print(list_xy)
Output
['a1', 'a2', 'a3', 'a4', 'b1', 'b2', 'b3', 'b4', 'c1', 'c2', 'c3', 'c4', 'd1', 'd2', 'd3', 'd4']
you may use any other operation instead of a+b
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…