Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
2.0 kB
6
Indexable
Never
import os
os.system('clear')

today = 'Run 5 km'
tomorrow = 'Lift 10 kg'
later = 'Cycle 30 km'


def menu():
    print(': THREE DAY PLANNER :')
    print('---------------------')
    print('    WORKOUT GOALS!   ')
    print('  ONE DAY AT A TIME. ')
    print('---------------------')


def table():
    print('TODAY: ', today)
    print('TOMORROW: ', tomorrow)
    print('LATER:', later)
    print('---------------------')


def operations():
    print('n | Next day')
    print('c | Change goal')
    print('e | Exit program')
    print('---------------------')


def change():
    print('0 | TODAY: ')
    print('1 | TOMORROW: ')
    print('2 | LATER:')
    print('---------------------')


while True:
    menu()
    table()
    operations()
    operation = input('operation > ')
    if operation == 'n':
        today = tomorrow
        tomorrow = later
        later = ''
        os.system('clear')

    elif operation == 'c':
        os.system('clear')
        menu()
        change()
        change_goal = input('Change goal for day > ')
        if change_goal == '0':
            today_goal = input('Goal for today > ')
            today = today_goal
            os.system('clear')

        elif change_goal == '1':
            tomorrow_goal = input('Goal for tomorrow > ')
            tomorrow = tomorrow_goal
            os.system('clear')

        elif change_goal == '2':
            later_goal = input('Goal for later > ')
            later = later_goal
            os.system('clear')

        else:
            print('------------------')
            print('ERROR: Bad day')
            print('INFO: Expected integer (0-2)')
            print('------------------')
            input('Press enter to continue...')
            os.system('clear')

    elif operation == 'e':
        exit()
        os.system('clear')

    else:
        print('ERROR: Unknown operation', '(' + operation + ')')
        input('Press enter to continue...')
        os.system('clear')