def main(): run = 1 db_helper.create_table() while run: print("\n") print('1. INSERT A TASK \n' '2. View tasks \n' '3. Delete tasks \n' '4. EXIT \n') x = input(" Enter your choice: ") if x == "1": task = str(input("Enter your task: ")) db_helper.data_entry(task) elif x == "2": db_helper.print_data() elif x == "3": IndexToDelete = int(print('enter the Task index to delete:')) db_helper.delete_task(IndexToDelete) elif x == "4": run = 0 else: print('choose a valid option') db_helper.close_cursor()
def main(): run = 1 db_helper.create_table() while run: print("\n") print('1. Insert new task in todo list \n' '2. View the todo list \n' '3. Delete the task \n' '4. exit \n') x = input("Choose any of above option: ") if x == "1": task = str(input("Enter your todo: ")) db_helper.data_entry(task) elif x == "2": db_helper.printData() elif x == "3": indexToDelete = int( input("Enter the index of the task to be deleted: ")) db_helper.deleteTask(indexToDelete) elif x == "4": run = 0 else: print("Please choose valid option") db_helper.closeCursor()
def main(): r = 1 db_helper.create_table() while(r): print("1. Insert New Task") print("2. View a Task") print("3. Delete a Task") print("4. Exit") x = input("Choose any option: ") print() if x == "1": task = str(input("Enter the Task: ")) db_helper.data_entry(task) elif x == "2": db_helper.printData() elif x == "3": index = int(input("Enter the task index: ")) db_helper.deleteTask(index) elif x == "4": r = 0 else: print("Enter values between 1 to 4 ") db_helper.closeCursor()
def main(): run = 1 db_helper.create_table() while run: print() print("1: Insert new task\n2:View Todo List\n3:Delete Todo\n0:Exit") x = int(input("Enter choice: ")) if x == 1: task = input("Enter task: ") db_helper.data_entry(task) elif x == 2: db_helper.printData() elif x == 3: index = int(input("Enter Todo Index to delete: ")) db_helper.deleteTask(index) elif x == 0: run = 0 else: print("Wrong choice...") db_helper.closeCursor()
def main(): run = 1 db_helper.create_table() while run: print( "1.insert the value\n2.printing the value\n3.deleting the value \n4.exit" ) choice = input("enter u r choice : ") if choice == "1": task = str(input("enter the todo: \n")) db_helper.data_entry(task) elif choice == "2": db_helper.printData() elif choice == "3": userid = str(input("enter the todo's userid to be deleted: \n")) db_helper.deleteTask(userid) elif choice == "4": run = 0 else: print("enter the valid choice") db_helper.closeCursor()