From 8c677bf3db52b0187ba9f2e554a70f0b55ebf41b Mon Sep 17 00:00:00 2001 From: Yakup Atas Date: Mon, 23 Sep 2024 21:11:19 +0200 Subject: [PATCH 1/4] first_initially_of_homework --- Task_Appication | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 Task_Appication diff --git a/Task_Appication b/Task_Appication new file mode 100644 index 0000000..07aeba0 --- /dev/null +++ b/Task_Appication @@ -0,0 +1,51 @@ +#add, complete, delete, and list their tasks. + + + + +def addTask(): + pass + +def completeTask(): + pass + +def delTask(): + pass + +def listTask(): + pass + +def quitTaskMenu(): + quit() + #sys.exit() #for this code You must call the sys module. + +print("-"*170) + +print( + """ + +1. Add to task +2. Comlete to task +3. Delelete to task +4. List to task +5. Quit + + """) + + +choice = int(input(" Enter your choice : ")).spli +if choice == 1 : + addTask() +elif choice == 2 : + completeTask() +elif choice == 3: + delTask() +elif choice ==4 : + listTask() +elif choice == 5: + quitTaskMenu() + +else : + + print(f" Please select the correct entry option:\n{"-"*50}\nLet it be between 1 and 5\n{"-"*50}\n") + \ No newline at end of file From e44509644e430f37151b6017a26ad99a4ac85390 Mon Sep 17 00:00:00 2001 From: Yakup Atas Date: Wed, 25 Sep 2024 16:38:42 +0200 Subject: [PATCH 2/4] versie_0 --- Task_Appication | 82 +++++++++++++++++++++++++++++++------------------ 1 file changed, 52 insertions(+), 30 deletions(-) diff --git a/Task_Appication b/Task_Appication index 07aeba0..275a589 100644 --- a/Task_Appication +++ b/Task_Appication @@ -12,40 +12,62 @@ def completeTask(): def delTask(): pass + def listTask(): pass + def quitTaskMenu(): quit() #sys.exit() #for this code You must call the sys module. -print("-"*170) - -print( - """ - -1. Add to task -2. Comlete to task -3. Delelete to task -4. List to task -5. Quit - - """) - - -choice = int(input(" Enter your choice : ")).spli -if choice == 1 : - addTask() -elif choice == 2 : - completeTask() -elif choice == 3: - delTask() -elif choice ==4 : - listTask() -elif choice == 5: - quitTaskMenu() - -else : - - print(f" Please select the correct entry option:\n{"-"*50}\nLet it be between 1 and 5\n{"-"*50}\n") - \ No newline at end of file + +def taskMenu(): + + while True : + + + + print( + """ + + 1. Add to task + 2. Comlete to task + 3. Delelete to task + 4. List to task + 5. Quit + + """) + choice = int(input(" Enter your choice : ")) + + + if choice == 1 : + addTask() + + + elif choice == 2 : + completeTask() + + + elif choice == 3: + delTask() + + + elif choice ==4 : + print("-"*170) + listTask() + + + elif choice == 5: + quitTaskMenu() + + + else : + + print(f" Please select the correct entry option:\nLet it be between 1 and 5\n") + + +if __name__ == "__main__" : + taskMenu() + + From 3a050b0a45f7f458e046833962acc51eb7273927 Mon Sep 17 00:00:00 2001 From: Yakup Atas Date: Sat, 28 Sep 2024 08:58:45 +0200 Subject: [PATCH 3/4] update_homework --- Task_Appication | 195 ++++++++++++++++++++++++++++++------------------ code_test.ipynb | 54 ++++++++++++++ 2 files changed, 178 insertions(+), 71 deletions(-) create mode 100644 code_test.ipynb diff --git a/Task_Appication b/Task_Appication index 275a589..38c4571 100644 --- a/Task_Appication +++ b/Task_Appication @@ -1,73 +1,126 @@ -#add, complete, delete, and list their tasks. - - - - -def addTask(): - pass - -def completeTask(): - pass - -def delTask(): - pass - - -def listTask(): - pass - - -def quitTaskMenu(): - quit() - #sys.exit() #for this code You must call the sys module. - - -def taskMenu(): - - while True : - - - - print( - """ - - 1. Add to task - 2. Comlete to task - 3. Delelete to task - 4. List to task - 5. Quit - - """) - choice = int(input(" Enter your choice : ")) - - - if choice == 1 : - addTask() - - - elif choice == 2 : - completeTask() - - - elif choice == 3: - delTask() - - - elif choice ==4 : - print("-"*170) - listTask() - - - elif choice == 5: - quitTaskMenu() - - - else : - - print(f" Please select the correct entry option:\nLet it be between 1 and 5\n") - - -if __name__ == "__main__" : - taskMenu() +# Görev durumları için sabitler +TAMAMLANDI = "Tamamlandı" +BEKLEMEDE = "Beklemede" +SILINDI = "Silindi" + +# Görev listesi ve boş slotlar +tasks = [] +empty_slots = [] + +# Görev ekleme fonksiyonu +def add_task(task_name): + task_id = len(tasks) + 1 if not empty_slots else empty_slots.pop(0) + tasks.append({"id": task_id, "task": task_name, "status": BEKLEMEDE}) + print(f"{task_name} adlı görev eklendi. Görev ID: {task_id}") + +# Görev tamamlama fonksiyonu +def complete_task(): + if not tasks: + print("Hiç görev yok.") + return + + print("\nTamamlanabilecek görevler:") + for task in tasks: + if task["status"] == BEKLEMEDE: + print(f"{task['id']}. {task['task']}") + + try: + task_id = int(input("Tamamlamak istediğiniz görevin numarasını girin: ")) + for task in tasks: + if task["id"] == task_id and task["status"] == BEKLEMEDE: + task["status"] = TAMAMLANDI + print(f"{task_id} numaralı görev tamamlandı.") + return + print("Geçersiz görev numarası.") + except ValueError: + print("Geçersiz giriş. Lütfen bir numara girin.") + +# Görev silme fonksiyonu +def delete_task(): + if not tasks: + print("Hiç görev yok.") + return + + print("\nSilinebilecek görevler:") + for task in tasks: + if task["status"] != SILINDI: + print(f"{task['id']}. {task['task']} - Durum: {task['status']}") + + try: + task_id = int(input("Silmek istediğiniz görevin numarasını girin: ")) + for task in tasks: + if task["id"] == task_id and task["status"] != SILINDI: + task["status"] = SILINDI + empty_slots.append(task_id) # Silinen görevin id'sini boş slotlara ekle + print(f"{task_id} numaralı görev silindi.") + return + print("Geçersiz görev numarası.") + except ValueError: + print("Geçersiz giriş. Lütfen bir numara girin.") + +# Tamamlanmış görevleri listeleme fonksiyonu +def list_completed_tasks(): + print("Tamamlanmış görevler:") + completed_tasks = [task for task in tasks if task["status"] == TAMAMLANDI] + if not completed_tasks: + print("Henüz tamamlanmış görev yok.") + else: + for i, task in enumerate(completed_tasks): + print(f"{i + 1}. {task['task']}") + +# Tüm görevleri listeleme fonksiyonu +def list_all_tasks(): + print("Tüm görevler:") + if not tasks: + print("Hiç görev yok.") + return + for task in tasks: + print(f"{task['id']}. {task['task']} - Durum: {task['status']}") + +# Görev arama fonksiyonu +def search_task(): + search_term = input("Aramak istediğiniz görev adını girin: ") + found_tasks = [task for task in tasks if search_term.lower() in task["task"].lower()] + + if found_tasks: + print("Bulunan görevler:") + for task in found_tasks: + print(f"{task['id']}. {task['task']} - Durum: {task['status']}") + else: + print("Hiçbir görev bulunamadı.") + +# Ana Menü +def main_menu(): + while True: + print("\n1. Yeni görev ekle") + print("2. Görev tamamla") + print("3. Görev sil") + print("4. Tamamlanmış görevleri listele") + print("5. Tüm görevleri listele") + print("6. Görev ara") + print("7. Çıkış") + choice = input("Bir seçenek girin: ") + if choice == '1': + task_name = input("Görev adını girin: ") + add_task(task_name) + elif choice == '2': + complete_task() + elif choice == '3': + delete_task() + elif choice == '4': + list_completed_tasks() + elif choice == '5': + list_all_tasks() + elif choice == '6': + search_task() + elif choice == '7': + print("Çıkılıyor...") + break + else: + print("Geçersiz seçim. Lütfen tekrar deneyin.") + +# Programı çalıştır +if __name__ == "__main__": + main_menu() diff --git a/code_test.ipynb b/code_test.ipynb new file mode 100644 index 0000000..13c0a4f --- /dev/null +++ b/code_test.ipynb @@ -0,0 +1,54 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1. Görev 1\n", + "2. Görev 2\n", + "3. Görev 3\n" + ] + } + ], + "source": [ + "tasks = [\"Görev 1\", \"Görev 2\", \"Görev 3\"]\n", + "\n", + "for i, task in enumerate(tasks):\n", + " print(f\"{i + 1}. {task}\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.2" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From 70eb2e0c3c2e6e761526a329c304317150c82ba1 Mon Sep 17 00:00:00 2001 From: y-atas Date: Sun, 29 Sep 2024 17:43:17 +0200 Subject: [PATCH 4/4] Update Task_Appication --- Task_Appication | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task_Appication b/Task_Appication index 38c4571..a636359 100644 --- a/Task_Appication +++ b/Task_Appication @@ -1,4 +1,4 @@ -# Görev durumları için sabitler +# Görev durumları için sabitler (Constants), Sabitler genelde buyuk harfle tanimlanir ornek : PI = 3,14 gibi. TAMAMLANDI = "Tamamlandı" BEKLEMEDE = "Beklemede" SILINDI = "Silindi"