Skip to content

Instantly share code, notes, and snippets.

@pdr-tuche
Last active December 6, 2022 14:35
Show Gist options
  • Save pdr-tuche/0f4298ed1aabefee2a8edc2a6e5775e0 to your computer and use it in GitHub Desktop.
Save pdr-tuche/0f4298ed1aabefee2a8edc2a6e5775e0 to your computer and use it in GitHub Desktop.
Script de contagem de dias
from datetime import datetime
user_input = input('entre com seu objetivo e deadline separados por (:)\n')
#colocando a string na lista
input_list = user_input.split(':')
#tratando a lista
objetivo =input_list[0]
deadline = input_list[1]
#preparando calculo dos dias
data_deadline = datetime.strptime(deadline, "%d.%m.%Y")
hoje = datetime.today()
diferenca = data_deadline - hoje
print(f'restam {diferenca.days} dias para {objetivo}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment