Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created August 14, 2021 18:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/c81b2666e1614d04f98163619f0236c0 to your computer and use it in GitHub Desktop.
Save parzibyte/c81b2666e1614d04f98163619f0236c0 to your computer and use it in GitHub Desktop.
def agregar_cero_si_es_necesario(valor):
return f"{valor:02d}"
numeros = [1, 2, 3, 55, 10, 100, 1000]
for numero in numeros:
print(agregar_cero_si_es_necesario(numero))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment