Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions Team1/haluk/hackerrank.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Find Digits



sayi=int(input())
rakamlar=[]
count=0
for rakam in str(sayi):
if rakam !='0':
rakamlar.append(int(rakam))
result= list(map(lambda x: sayi%x==0,rakamlar))
for i in result:
if i is True:
count+=1
elif i is False:
count+=0
print(count)


# Capitalize



s= input('Bir metin giriniz :')
def solve(s):
if s[0].isdigit():
return s
else:
return s.title()

print(solve(s))
83 changes: 83 additions & 0 deletions Team1/haluk/homework.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@


task_list = {}
task_squence = 100

while True:

print("Task Manager System\n")

print("Please choose one of the actions below.\n")

print("1. Add a new task")
print("2. Complete a task")
print("3. Delete a task")
print("4. List completed tasks")
print("5. List all tasks with their status")
print("6. Exit\n")

choice = input("Please enter the action number you would like to take: ")


if choice == '1':
#Add a new task
task_squence += 1
def add_new_task():

task_name = input("Please enter a name for the task: ")
task_list[task_squence] = {'name' : task_name, 'status' : 'Incomplete'}
print(f"\nThe new task named {task_name} is listed with {task_squence} task ID.\n")
add_new_task()


elif choice == '2':
#Complete a task
def complete_task():
task_id = int(input("Please enter the task ID: "))

if task_id in task_list:
task_list[task_id]['status'] = 'Completed'

print(f"\nThe task {task_id} is completed.\n")
else:
print("\nTask ID not found.\n")
complete_task()


elif choice == '3':
#Delete a task
def delete_task():
task_id = int(input("Please enter a task ID to be deleted: "))
if task_id in task_list:
del task_list[task_id]

print(f"The task {task_id} is deleted.\n")
delete_task()
elif choice == '4':
# List completed tasks
def list_completed_tasks():
print("Completed Tasks:")
for task_id, task in task_list.items():
if task['status'] == 'Completed':
print(f"ID: {task_id}, Name: {task['name']}")
if not any(task['status'] == 'Completed' for task in task_list.values()):
print("No completed tasks found.\n")
list_completed_tasks()




elif choice == '5':
#List all tasks with their status
def list_all_tasks():
for task_id, task in task_list.items():
print(f"ID: {task_id}, Name: {task['name']},Status: {task['status']}")
print("The statuses of the tasks listes.")
list_all_tasks()

elif choice == '6':
print("Exiting...")
break



Empty file added Team1/islam/hackerrank.py
Empty file.
81 changes: 81 additions & 0 deletions Team1/islam/homework.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
task_list = {}
task_squence = 100

while True:

print("Task Manager System\n")

print("Please choose one of the actions below.\n")

print("1. Add a new task")
print("2. Complete a task")
print("3. Delete a task")
print("4. List completed tasks")
print("5. List all tasks with their status")
print("6. Exit\n")

choice = input("Please enter the action number you would like to take: ")


if choice == '1':
#Add a new task
task_squence += 1
def add_new_task():

task_name = input("Please enter a name for the task: ")
task_list[task_squence] = {'name' : task_name, 'status' : 'Incomplete'}
print(f"\nThe new task named {task_name} is listed with {task_squence} task ID.\n")
add_new_task()


elif choice == '2':
#Complete a task
def complete_task():
task_id = int(input("Please enter the task ID: "))

if task_id in task_list:
task_list[task_id]['status'] = 'Completed'

print(f"\nThe task {task_id} is completed.\n")
else:
print("\nTask ID not found.\n")
complete_task()


elif choice == '3':
#Delete a task
def delete_task():
task_id = int(input("Please enter a task ID to be deleted: "))
if task_id in task_list:
del task_list[task_id]

print(f"The task {task_id} is deleted.\n")
delete_task()
elif choice == '4':
# List completed tasks
def list_completed_tasks():
print("Completed Tasks:")
for task_id, task in task_list.items():
if task['status'] == 'Completed':
print(f"ID: {task_id}, Name: {task['name']}")
if not any(task['status'] == 'Completed' for task in task_list.values()):
print("No completed tasks found.\n")
list_completed_tasks()




elif choice == '5':
#List all tasks with their status
def list_all_tasks():
for task_id, task in task_list.items():
print(f"ID: {task_id}, Name: {task['name']},Status: {task['status']}")
print("The statuses of the tasks listes.")
list_all_tasks()

elif choice == '6':
print("Exiting...")
break



24 changes: 24 additions & 0 deletions Team1/yasin/gorevler.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"gorevler": [
{
"id": "1",
"gorev": "Ilk todom Eklendi",
"durum": "Tamamlandi"
},
{
"id": "2",
"gorev": "Ucuncu Todo mu ekledim",
"durum": "Bekliyor"
},
{
"id": "3",
"gorev": "3.Hafta odevimi bitirdim",
"durum": "Tamamlandi"
},
{
"id": "4",
"gorev": "Hackerrank odevleri yapilacak",
"durum": "Bekliyor"
}
]
}
21 changes: 21 additions & 0 deletions Team1/yasin/hackerrank.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#1- HACKERRANK: FIND DIGITS
def sayi_bul(sayi):
sonuc =0
for rakam in str(sayi):
rakam = int(rakam)
if rakam == 0:
continue
if sayi % rakam == 0:
sonuc += 1
return sonuc

print(sayi_bul(123))

#2-HACKERRANK: CAPITALIZE
def solve(user_name):
return user_name.title()

user_name = "chris alan"
result = solve(user_name)

print(result)
149 changes: 149 additions & 0 deletions Team1/yasin/homework.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
import json

gorev_id = 1

json_dosya = "c:\\Users\\harri\\Desktop\\Python_Modul_Week_3\\Team1\\yasin\gorevler.json"
def dosya_yukle():
try:
with open(json_dosya, "r") as dosya:
return json.load(dosya)
except (FileNotFoundError, json.JSONDecodeError): # Dosya yoksa veya geçersizse
return {}

def kaydet(veriler):
with open(json_dosya, "w", encoding="utf-8") as dosya:
json.dump(veriler, dosya, ensure_ascii=False, indent=2)

def gorev_ekle():
todos = dosya_yukle() # Mevcut görevleri yükle

# Görev listesini kontrol et
if "gorevler" not in todos:
todos["gorevler"] = [] # Eğer görevler listesi yoksa oluştur

# Görev listesini al
gorevler = todos["gorevler"]

# ID'yi otomatik olarak artır
if gorevler: # Eğer görevler listesi boş değilse
gorev_id = int(gorevler[-1]["id"]) + 1 # Son görevin ID'sine bak ve artır
else:
gorev_id = 1 # Görev listesi boşsa, ID 1'den başla

# Yeni görev oluştur
yeni_gorev = {
"id": str(gorev_id), # ID'yi string olarak sakla
"gorev": input("Yeni bir Todo Ekleyin: "), # Kullanıcıdan görev al
"durum": "Bekliyor" # Varsayılan durum: Bekliyor
}

# Yeni görevi listeye ekle
gorevler.append(yeni_gorev)

# JSON dosyasına kaydet
kaydet(todos)
print(f"{yeni_gorev['id']} ID'li görev eklendi!")

def gorev_tamamla():
todos = dosya_yukle()
gorevler = todos["gorevler"] # "gorevler" anahtarına eriş
print("Görevler:", gorevler) # Yapıyı kontrol edin

gorev_sec = input("Bir Görev ID'si seçiniz: ")

for gorev in gorevler:
gorev["id"] = str(gorev["id"]) # ID'yi string'e dönüştür

for gorev in gorevler:
if isinstance(gorev, dict): # gorev'in sözlük olup olmadığını kontrol et
if gorev["id"] == gorev_sec:
gorev["durum"] = "Tamamlandi"
print(f"{gorev_sec} ID'li görevin durumu başariyla tamamlandi!")
kaydet(todos) # Güncellenmiş veriyi dosyaya kaydet
return
else:
print("Beklenmeyen veri formati:", gorev) # Hatalı veri tipi tespit et
return
print("Bu ID'ye sahip bir görev yok!")

def gorev_sil():
todos = dosya_yukle() # Görev listesini yükle
gorevler = todos["gorevler"] # Görevlerin listesini al
gorev_sec = input("Silmek istediğiniz Görevin ID'sini seçiniz: ")

# ID'leri string'e dönüştür
for gorev in gorevler:
gorev["id"] = str(gorev["id"])

# Görev silme işlemi
for gorev in gorevler:
if gorev["id"] == gorev_sec:
silinen_todo = gorev # Silinen görevi kaydetmek için
gorevler.remove(gorev) # Liste üzerinden görevi kaldır

# Görev silindikten sonra ID'leri yeniden sırala
for index, gorev in enumerate(gorevler, start=1):
gorev["id"] = str(index) # ID'yi yeniden sırala (1'den başlayarak)

print(f"{silinen_todo['gorev']} görevi başarıyla silindi!")
kaydet(todos) # Güncellenmiş veriyi dosyaya kaydet
return

# Eğer ID bulunamazsa hata mesajı göster
print("Bu ID'ye sahip bir görev yok!")

def tum_gorevler():
todos = dosya_yukle()
if "gorevler" in todos and todos["gorevler"]:
print("Tum Gorevler Listesi: ")
for x in todos["gorevler"]:
print(f"ID: {x['id']}, Gorev: {x['gorev']}, Durum: {x['durum']}")
else:
print("Henuz bir Todo Yok!!")

def tamamlanan_gorevler():
todos = dosya_yukle()
gorevler = todos["gorevler"]
for gorev in gorevler:
if gorev["durum"] == "Tamamlandi":
print(gorev)
kaydet(todos)
return

print("Tamamlanan Gorevler")
def bekleyen_gorevler():
todos = dosya_yukle()
gorevler = todos["gorevler"]
for gorev in gorevler:
if gorev["durum"] == "Bekliyor":
print(gorev)
kaydet(todos)
return
import os
while True:
os.system("cls")
print("""
Gorev Yonetici Uygulamasi :
1- Yeni Gorev Ekle
2- Gorevi Tamamla
3- Gorev sil
4- Tum Gorevler
5- Tamamlanan Gorevler
6- Tamamlanan Gorevler
""")
secim = input("Bir Islem Seciniz...")

if secim == "1":
gorev_ekle()
elif secim == "2":
gorev_tamamla()
elif secim == "3":
gorev_sil()
elif secim == "4":
tum_gorevler()
elif secim == "5":
tamamlanan_gorevler()
elif secim == "6":
bekleyen_gorevler()

input("Devam Etmek Icin Enter'e Basiniz..")
Loading