Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Created December 27, 2019 16:04
Show Gist options
  • Save Fhernd/d0880a3d133e984fb344ed36e281dfbb to your computer and use it in GitHub Desktop.
Save Fhernd/d0880a3d133e984fb344ed36e281dfbb to your computer and use it in GitHub Desktop.
# Ejercicio 456: Repetir un elemento cierta cantidad de veces con la clase Counter.
# Ejercicio 456: Repetir un elemento cierta cantidad de veces con la clase Counter.
from collections import Counter
contador = Counter(a=5, e=4, i=0, o=-1, u=2)
print(contador)
print()
elementos_repetidos = list(contador.elements())
print(type(elementos_repetidos))
print(elementos_repetidos)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment