Advertisement
GastonPalazzo

List & Dict - Listas - Ej-7

Aug 22nd, 2020
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. print('|Ej 7|')
  2.  
  3. animales = ["oso hormiguero", "tejon", "pato", "emu", "zorro del desierto"]
  4.  
  5. print('\nLista de animales original -> ', animales)
  6.  
  7. if animales.count('pato')>0:
  8.     animales[animales.index('pato')]='cobra'
  9.  
  10. print('\nLista de animales modificada -> ', animales)
  11.  
  12. print('\nFin de la ejecucion!\n')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement