Created
March 21, 2021 21:19
-
-
Save andeoliveira/ebcfad8a0e310d5089f848139f843af1 to your computer and use it in GitHub Desktop.
Adiciona um elemento em uma posição específica na lista Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Adicionar um item na Lista Python na primeira posição | |
lista_bandas = ["Metallica","AC/DC","The Who","Ramones"] | |
lista_bandas.insert(0, "The Beatles") #Adiciona a banda The Beatles na primeira posição da lista | |
print(lista_bandas) #['The Beatles', 'Metallica', 'AC/DC', 'The Who', 'Ramones'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment