xxxxxxxxxx
list1 = ["M", "na", "i", "Ke"]
list2 = ["y", "me", "s", "lly"]
list3 = [i + j for i, j in zip(list1, list2)]
print(list3)
# My name is Kelly
xxxxxxxxxx
list1 = ["a", "b" , "c"]
list2 = [1, 2, 3]
list1.extend(list2)
print(list1)
xxxxxxxxxx
list1 = [1, 2, 3]
list2 = [4, 5, 6]
concatenated_list = list1 + list2
print(concatenated_list)
xxxxxxxxxx
#plz susciibe to my youtube channel -->
#https://www.youtube.com/channel/UC-sfqidn2fKZslHWnm5qe-A
list1 = [1,2,3,4,5,6]
list2 = [7,8,9,10,11,12]
numbers_list = list1 + list2
print(numbers_list)
xxxxxxxxxx
list1 = ["Hello ", "take "]
list2 = ["Dear", "Sir"]
resList = [x+y for x in list1 for y in list2]
print(resList)
#['Hello Dear', 'Hello Sir', 'take Dear', 'take Sir']
xxxxxxxxxx
>>> l1 = [1, 2, 3]
>>> l2 = [4, 5, 6]
>>> joined_list = [*l1, *l2] # unpack both iterables in a list literal
>>> print(joined_list)
[1, 2, 3, 4, 5, 6]
xxxxxxxxxx
listone = [1, 2, 3]
listtwo = [4, 5, 6]
joinedlist = listone + listtwo
xxxxxxxxxx
# Makes list1 longer by appending the elements of list2 at the end.
list1.extend(list2)
xxxxxxxxxx
#define lists
my_list = ["a", "b"]
other_list = [1, 2]
#extend my_list by adding all the values from other_list into my list
my_list.extend(other_list)
# output: ['a', 'b', 1, 2]