Make a productivity guide using python (BEGINNER'S LEVEL)
Hey guys once again welcome to the Decoders blog, I hope you all are doing well and today I'm present with another astonishing productivity guide(using PYTHON). The given code will help you to built it, so just follow the codes and make your own guide easily , and enjoy it with your friends
from datetime import datetime
now=datetime.now()
current_time=now.strftime("%H:%M:%S")
print("welcome to forest app")
choose=input("Do you want to see your progress or enter your productive hours:")
if choose=="progress":
with open("plants1.txt") as op:
for i in op:
print(i)
elif choose=="plant":
x=input("enter number of productive hours you spent today:")
with open("plants1.txt","a") as op:
op.write("At "+current_time+" you planted:"+x+"trees"+"\n")
print("successfully written")
else:
print("invalid input")
Comments
Post a Comment