def get_task_name(path_to_db): print("\nPlease insert the task name, case sensitive. It must not exist.") all_tasks = DbHandler.get_all_tasks(path_to_db) all_tasks = [x.lower() for x in all_tasks] while True: task_name = input("Task name: ") if task_name.lower() in all_tasks: print("This task already exists.") else: return task_name
def get_task_name(path_to_db): print( "\nPlease insert the task name, case insensitive. It must not exist.") all_tasks = DbHandler.get_all_tasks(path_to_db) while True: task_name = input("Task name: ") for task in all_tasks: if task.lower() == task_name.lower(): return task print("This task does not exist.")