Last active
December 6, 2022 14:35
-
-
Save pdr-tuche/0f4298ed1aabefee2a8edc2a6e5775e0 to your computer and use it in GitHub Desktop.
Script de contagem de dias
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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