2021-07-31 17:37:36 +04:00

46 lines
1.5 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Запрашивать у пользователя команду.
# В зависимости от введенной команды выполнять действие.
HELP = '''
* help - напечатать справку по программе.
* add - добавить задачу в список (название задачи запрашиваем у пользователя).
* show - напечатать все добавленные задачи.
'''
tasks = []
today = []
tomorrow = []
other = []
# command = input("Введите команду: ")
while True:
command = input("Введите команду: ")
if command == "help":
print(HELP)
elif command == "add":
task = input("Введите задачу: ")
date = input("Введите дату: ")
if date == "Сегодня":
today.append(task)
elif date == "Завтра":
tomorrow.append(task)
else:
other.append(task)
print("Задача добавлена")
elif command == "show":
print('today tasks:')
for task in today:
print(task)
print('tomorrow tasks:')
for task in tomorrow:
print(task)
print('other tasks:')
for task in other:
print(task)
elif command == "exit":
print("Спасибо за использование! До свидания!")
break
else:
print("Неизвестная команда!")
print(HELP)
break