Skip to content

Instantly share code, notes, and snippets.

View omarsalazar's full-sized avatar
🛎️
Timbranding

Omar S Pz omarsalazar

🛎️
Timbranding
  • México, D.F.
View GitHub Profile
def get_monthly_profit(savings: float, performance: float) -> float:
"""
Calculates the monthly investment return
:param savings: saved money
:param performance: investment performance
:return: monthly profit
"""
profit = (savings * (performance / 100)) / 12
return profit

Keybase proof

I hereby claim:

  • I am omarsalazar on github.
  • I am not_ospz (https://keybase.io/not_ospz) on keybase.
  • I have a public key ASAqfyHouusrL2RqOByL1tZ39upR_7BANkSlNnJxwT3rSgo

To claim this, I am signing this object:

@omarsalazar
omarsalazar / palindrome.py
Last active July 13, 2019 22:17
Verifies if an input is palindrome.
special_characters = ["!", "¡", "¿", "?", ".", ","]
user_input = input("Ingresa algun palindromo: \n")
if len(user_input) > 1:
for character in user_input:
if character in special_characters:
text = user_input.replace(character, "")
user_input = text
nonspaced_input = user_input.replace(" ", "").lower()
table = nonspaced_input.maketrans("áéíóúü", "aeiouu")
import base64
encoded_file = base64.b64encode(open("filename.txt", "rb").read())
with open("EncodedData.txt", "wb") as output_file:
output_file.write(encoded_file)
@omarsalazar
omarsalazar / cumpleaños.py
Last active July 14, 2019 05:31
Escribe tu fecha de nacimiento y te diré cuantos años tienes, si ya fue tu cumpleaños o cuantos días faltan :D
import pendulum
# Installing instractions and documentation of pendulum https://pendulum.eustace.io/docs/#installation
date = input("Ingresa tu fecha de nacimiento (AAAA-mm-dd): \n")
date = pendulum.parse(date)
today = pendulum.now()
time = today - date
birth_date = pendulum.parse("{}-{}-{}".format(today.year, date.month, date.day), strict=False)
if birth_date < today:
print("Tu cumpleaños ya fue, tienes {} años uwu".format(time.in_years()))