import os, time, sys
def clearConsole():
os.system('cls' if os.name in ('nt', 'dos') else 'clear')
# global variables
DAYS_IN_WEEK = [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ]
goals = []
def main_display():
clearConsole()
print("Weekly Planner")
print("1, Set Goals")
print("2, View Goals")
print("3, Exit")
def message_display(message):
print(f"\n:: {message}")
time.sleep(3)
main_menu()
def set_goals():
print()
for day in DAYS_IN_WEEK:
print(f"{day}, ", end="")
goal = (input()).strip(' \t\n\r')
if goal:
goals.append(f"{day}, {goal}")
sys.stdout.write("\033[F") # Move the cursor up one line
print(f"{day}, {goal} :: entered goal successfully")
def view_goals():
if not goals:
message_display("No goals entered yet")
else:
print("\nWeekly Plan")
for goal in goals:
print(goal)
def main_menu():
main_display()
choice=input("Enter choice 1/2/3: ")
if choice == "1":
set_goals()
input("\nPress Enter to continue ...")
elif choice== "2":
view_goals()
input("\nPress Enter to continue ...")
elif choice== "3":
message_display("Exiting the Planner!")
# your code for exit action
else:
message_display("Invalid number. Try again")
main_menu()
def main():
main_menu()
if __name__ == "__main__":
main()