Skip to content

Instantly share code, notes, and snippets.

@christiancost47
Created August 25, 2019 19:21
Show Gist options
  • Save christiancost47/2ff168c4402a2f149580f7acd4b46548 to your computer and use it in GitHub Desktop.
Save christiancost47/2ff168c4402a2f149580f7acd4b46548 to your computer and use it in GitHub Desktop.
removing_stuff
#>>>> Removendo itens pela posição
empresas_tecnologia = ['tesla', 'google', 'dropbox', 'apple', 'nubank']
del empresas_tecnologia[0] #deleta o index 0
>>>['google', 'dropbox', 'apple', 'nubank']
del empresas_tecnologia[2] #deleta o index 2
>>>['google', 'dropbox', 'nubank']
#>>>>Removendo itens pelo valor
empresas_tecnologia = ['tesla', 'google', 'dropbox', 'apple', 'nubank']
empresas_tecnologia.remove('dropbox') #remove o valor 'dropbox'
>>>['tesla', 'google','apple', 'nubank']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment