Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created May 24, 2021 17:46
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/a0eab6ebfd5faa1a69e20f9f8dd472ad to your computer and use it in GitHub Desktop.
Save parzibyte/a0eab6ebfd5faa1a69e20f9f8dd472ad to your computer and use it in GitHub Desktop.
"""
https://parzibyte.me/blog
"""
def diferencia_en_porcentaje(a, b):
return ((b/a) * 100) - 100
inicio = 1
fin = 100
while inicio <= 100:
diferencia = diferencia_en_porcentaje(inicio, fin)
diferencia_redondeada = round(diferencia, 2)
print(
f"Entre {inicio} y {fin} hay una diferencia de {diferencia_redondeada} %")
inicio += 1
fin -= 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment