From aba087df9758960e52dc41ec6024d31a0fb0f047 Mon Sep 17 00:00:00 2001 From: babajanbazarovnl-ux Date: Mon, 8 Sep 2025 13:09:35 +0200 Subject: [PATCH 1/2] Create team3_week1.py --- team3_week1.py | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 team3_week1.py diff --git a/team3_week1.py b/team3_week1.py new file mode 100644 index 0000000..f063246 --- /dev/null +++ b/team3_week1.py @@ -0,0 +1,59 @@ +#proje 1 +movies = [] + +for i in range (3): + movie=input (f"Enter your favourite movie {i+1}:") + movies.append(movie) + +print("\nYour favourite movie list:",movies) + +print("First movie:", movies[0]) + +print("Last movie:", movies[-1]) + +print("Number of movies:", len(movies)) + +#proje 2 +age = int(input("Enter your age: ")) +if age < 18: + print("You are not an adult.") +else: + print("You are an adult.") + +birth_year= int(input("Enter your birth year: ")) +age = 2025 - birth_year +print(f"Your age is {age} ") + +#proje 3 +sentence = input ("Enter a sentence: ") + +character_count = len(sentence.replace(" ", "")) +print(f"Character count (excluding spaces) :{character_count}") + +words = sentence.split() +words_count = len(words) +print(f" Words count : {words_count}") + +unique_words = set(words) +print(f" Unique_words : {unique_words}") + +longest_word = max(words, key=len) +print(f" The longest word : {longest_word}") + +#proje 4 +products = {"apple": 3, "banana": 5, "bread": 2, "milk": 4} + +your_basket = [] +total_price = 0 +for i in range(3): + choosen_products = input(f"Plase choose a product {i+1}:") + if choosen_products in products: + your_basket.append(choosen_products) + total_price += products[choosen_products] + else: + print(f"Sorry, {choosen_products} doesn't exist") + +print("Your basket:", ", ".join(your_basket)) +print("Your total price:", total_price, "TL") + +#proje 5 From 324ac21fbe3a1f033191314ce1968becc38e726d Mon Sep 17 00:00:00 2001 From: babajanbazarovnl-ux Date: Mon, 8 Sep 2025 14:49:22 +0200 Subject: [PATCH 2/2] Update team3_week1.py --- team3_week1.py | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/team3_week1.py b/team3_week1.py index f063246..71e4f93 100644 --- a/team3_week1.py +++ b/team3_week1.py @@ -57,3 +57,78 @@ print("Your total price:", total_price, "TL") #proje 5 +students = {} + + +for i in range(3): + ad = input(f"{i+1}.ogrenci adı: ") + notlar = [] + for j in range(3): + notu = int(input(f"{ad} adlı ogrencinin {j+1}.notunu gir: ")) + notlar.append(notu) + students[ad] = notlar +print("\nOgrenci ortalamalari: ") + +ortalamalar = {} +for isim, notlar in students.items(): + ort = sum(notlar) / len(notlar) + ortalamalar[isim] = ort + print(f"{isim}: {ort}") + +yuksek_ogr = max(ortalamalar, key =ortalamalar.get) +yuksek_ort = ortalamalar[yuksek_ogr] +print(f"\nYuksek ortalama: {yuksek_ogr} ({yuksek_ort})") + +#proje 6 +library = {"python101": "Available", "dataScience": "Available", "algorithms": "Available"} +odunc_alınan_kitaplar = set() + +while True: + secim = input("Kitap eklemek için 1 e basın:" + "Kitap ödünç almak için 2 ye basın:" + "Kitap iade etmek için 3 e basın:" + "Tüm kitapları görüntülemek için 4 e basın:" + "çıkış için 5 e basın:") + if secim=="1": + kitap = input("eklemek istediğiniz kitabın adını yazın:").lower() + if kitap in library: + print ("bu kitap zaten mevcut") + elif kitap not in library: + library[kitap]= "Available" + elif secim == "2": + kitap2 = input("ödünç almak istediğiniz kitabın adını yazın:").lower() + if kitap2 in library: + if library[kitap2]== "Available": + print("kitabı alabilirsiniz") + library[kitap2] = "Borrowed" + odunc_alınan_kitaplar.add(kitap2) + else: + print("kitap şuan ödünçte") + else : + print("kitap mevcut değil") + elif secim=="3": + kitap3 = input("geri vermek istediğiniz kitabın adını yazın:").lower() + if kitap3 not in odunc_alınan_kitaplar: + print("bu kitap ödünç alınmamıştır") + else : + library[kitap3] = "Available" + odunc_alınan_kitaplar.remove(kitap3) + print("kitabı geri verdiniz") + elif secim=="4": + for key,value in library.items(): + print (key," : ",value) + + print("\n--- Statistics ---") + total_books = len(library) + available_books = list(library.values()).count("Available") + borrowed_books = list(library.values()).count("Borrowed") + + print(f"Total books: {total_books}") + print(f"Available books: {available_books}") + print(f"Borrowed books: {borrowed_books}") + + elif secim=="5": + print("programdan çıkılıyor") + break + else: + print("geçersiz seçim,tekrar deneyin")