Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Created December 26, 2019 00:23
Show Gist options
  • Save Fhernd/e2e1cb334f034028e228559cba6280a8 to your computer and use it in GitHub Desktop.
Save Fhernd/e2e1cb334f034028e228559cba6280a8 to your computer and use it in GitHub Desktop.
# Ejercicio 424: Contar el número de ocurrencias de un elemento en una tupla.
# Ejercicio 424: Contar el número de ocurrencias de un elemento en una tupla.
numeros = (2, 3, 2, 2, 5, 5, 3, 7, 11, 13, 13, 2, 19, 23)
print(numeros)
cantidad_dos = numeros.count(2)
print('El número 2 aparece {} veces.'.format(cantidad_dos))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment