Create Simple_Counter_App.py

pull/1016/head
Syed Mustafa Hassan 2024-02-27 00:50:45 +05:00 committed by GitHub
parent 28bfaa3d03
commit e8db7c060a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,14 @@
import datetime
user_input = input("Enter your goal with a deadline separatedby colon\n")
input_list = user_input.split(":")
# goal = input_list[0]
deadline = input_list[0]
deadline_date = datetime.datetime.strptime(deadline, "%d.%m.%Y")
today_date = datetime.datetime.today()
time_till = deadline_date - today_date
hours_till = int(time_till.total_seconds()/ 60/ 60)
print(f"Dear User! Time remanning for your goal : {goal} is {hours_till} hours")