extend in list python code example
Example 1: python array extend
my_list = ['a','b']
my_list.append('c')
print(my_list)
other_list = [1,2]
my_list.append(other_list)
print(my_list)
my_list.extend(other_list)
print(my_list)
Example 2: extend a list python
list1 = [1,2,3,4,5]
list1.extend([6,7,8])
print(list1)
Example 3: python list extend not working
techlux.ga techlux.ga techlux.ga techlux.ga techlux.ga techlux.ga techlux.ga techlux.ga techlux.ga techlux.ga techlux.ga techlux.ga techlux.ga techlux.ga techlux.ga techlux.ga techlux.ga techlux.ga techlux.ga techlux.ga techlux.ga techlux.ga techlux.ga techlux.ga techlux.ga techlux.ga techlux.ga techlux.ga techlux.ga techlux.ga techlux.ga techlux.ga techlux.ga techlux.ga techlux.ga techlux.ga
Example 4: extend in list python
subjects=["Maths","Science","Arts","Commerce"]
subjects_2=["Artificial intelligence","Statistics"]
subjects.extend(subjects_2)
print(subjects)