Become Healthy Goal - Python Program
def gettime(): import time return time.asctime(time.localtime(time.time())) def log(): while True : choice = int ( input ( "Enter 1 for Diet, 2 for exercise: " )) if choice== 1 : diet= input ( "Enter Food Name: " ) with open ( "deep-food.txt" , "a" ) as d: d.write( str ([ str (gettime())]) + ": " + diet) print ( "Add successfuly!" ) elif choice== 2 : exercise= input ( "Enter Exercise Name: " ) with open ( "deep-exercise.txt" , "a" ) as d: d.write( str ([ str (gettime())]) + ": " + exercise) print ( "Add Successfuly!" ) ans= input ( "Do you want to add 'diet or exercise' \n Type Y for yes and Type N for no: " ) if ans== 'n' : print ( "Good bye!" ) break def retreiv...
Comments
Post a Comment