“Lista de Python Extend ()” Respostas de código

Lista de Python Extend ()

Difference between List append() and List extend() method
a =[1,2]
b= [3,4]

# append() method 
a.append(b)
print("Using append() method", a)

x =[1,2]
y= [3,4]


# extend() method 
x.extend(y)
print("Using extend() method", x)
Gorgeous Gazelle

Lista de Python Extend ()

Python Program to extend the list
# Programming list
programming_list = ['C','C#','Python','Java']

frontend_programming =['CSS','HTML','JavaScript']

# add the frontend_progamming list into the existing list
programming_list.extend(frontend_programming)

# Note that iterable element is added to the end of the list
print('The new extended list is :', programming_list)
Gorgeous Gazelle

Respostas semelhantes a “Lista de Python Extend ()”

Perguntas semelhantes a “Lista de Python Extend ()”

Procure respostas de código populares por idioma

Procurar outros idiomas de código