From 462ed39c9529b9c0ce5c240f279afbcaa1794ccc Mon Sep 17 00:00:00 2001 From: BeyzaNurSarikaya <161241878+BeyzaNurSarikaya@users.noreply.github.com> Date: Sat, 11 Oct 2025 17:12:49 +0200 Subject: [PATCH] Add files via upload --- VIT9_Team3_Week1.py | 171 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 VIT9_Team3_Week1.py diff --git a/VIT9_Team3_Week1.py b/VIT9_Team3_Week1.py new file mode 100644 index 0000000..8e95416 --- /dev/null +++ b/VIT9_Team3_Week1.py @@ -0,0 +1,171 @@ +# Python_Modul_Week_1 +# Beginner Python Projects + +# Project 1: Favorite Movie List +print('Your Top 3 Movie List') +movies=[input('Number1:'),input('Number2:'),input('Number3:')] +print(movies) +print('Your first movie is:',movies[0]) +print('Your last movie is:',movies[2]) +print('total number of movies:',len(movies)) + +#--------------------------------------------- +# Project 2: Age Check +yas= int(input("Lutfen Yasinizi Giriniz:")) +if yas <= 18: + print("Yetiskin degilsiniz.") +else: + print("Yetiskinsiniz.") +dogum_yili = input("Lutfen dogum yilinizi giriniz:") +hesaplanan_yas = 2025 - int(dogum_yili) +print("2025 yili itibariyle yasiniz:", hesaplanan_yas) + +#---------------------------------------------- +# Project 3: Word Analysis Tool +cumle = input("Lutfen bir cumle giriniz:") +bosluk_sil = cumle.replace(" ", "") +tekrarsiz = set(cumle.split()) +en_uzun="" +for kelime in tekrarsiz: + if len(kelime)>len(en_uzun): + en_uzun=kelime + +print("Cumlenizin analizi yapiliyor...") +print("Cumlenizdeki karakter sayisi (bosluklar haric):", len(bosluk_sil)) +print("Cumlenizdeki tekrarsiz (farkli) kelimeler :", tekrarsiz) +print("Cumlenizdeki en uzun kelime:", en_uzun) + +#---------------------------------------------- +# Project 4: Mini Market Basket +print('Mini Market Basket') +products = {"apple": 3, "banana": 5, "bread": 2, "milk": 4, + 'coffee':8,'chocolate':3,'tea':2,'egg':3 +} +p1=input("Enter your first product: ").lower() +p2=input("Enter your second product: ").lower() +p3=input("Enter your third product: ").lower() + +your_basket={} +for p in [p1,p2,p3]: + if p in products: + your_basket[p]=products[p] + else: + print(f"'{p}' is not in our market.") +print('your basket is full of with',list(your_basket.keys())) +total=sum(your_basket.values()) +print('Total price is:',total,"Euro") + +#------------------------------------------------ +# Project 5: Student Grading System +students = {} + +for i in range(3): + name = input(f"\n{i+1}. öğrenci adı: ") + + # 3 not al + grades = [] + for j in range(3): + grade = float(input(f"{name}'in {j+1}. notu: ")) + grades.append(grade) + + students[name] = grades + +print("\n" + "="*30) +print("ÖĞRENCİ ORTALAMALARI") +print("="*30) + +for student, grades in students.items(): + average = sum(grades) / len(grades) + print(f"{student}: {grades} -> Ortalama: {average:.1f}") + +print("EN YÜKSEK ORTALAMA") +print("="*30) + +max_student = "" +max_average = 0 + +for student, grades in students.items(): + average = sum(grades) / len(grades) + if average > max_average: + max_average = average + max_student = student + +print(f"En yüksek ortalamaya sahip öğrenci: {max_student}") +print(f"Ortalaması: {max_average:.1f}") + +#---------------------------------------------- +# Project 6: Mini Library Management System +library = { + "Python101": "Available", + "DataScience": "Available", + "Algorithms": "Available" +} + +borrowed_books = set() + +def find_book_key(book_name): + for key in library.keys(): + if key.lower() == book_name.lower(): + return key + return None + + + +while True: + print("Menu:") + print("1 - Add Book") + print("2 - Borrow Book") + print("3 - Return Book") + print("4 - View All Books") + print("5 - Exit") + + choice = int(input("Your choice:")) + + if choice == 1: + book_name = input("Enter the book you want to add:").strip() + existing_key = find_book_key(book_name) + if existing_key: + print(f"{existing_key} already exists in the library.") + else: + formatted_name = book_name.title() + library[formatted_name] = "Available" + print(f"{formatted_name} has been successfully added to our library.") + + elif choice == 2: + book_name = input("Enter the book you want to borrow:").strip() + existing_key = find_book_key(book_name) + if not existing_key: + print(f"{book_name.title()} is not in the library.") + elif library[existing_key] == "Borrowed": + print(f"{existing_key} is already borrowed.") + else: + library[existing_key] = "Borrowed" + borrowed_books.add(existing_key) + print(f"You have borrowed {existing_key}.") + + elif choice == 3: + book_name = input("Enter the book you want to return:").strip() + existing_key = find_book_key(book_name) + if not existing_key: + print(f"'{book_name.title()}' is not in the library.") + elif library[existing_key] == "Available": + print(f"'{existing_key}' was not borrowed.") + else: + library[existing_key] = "Available" + borrowed_books.discard(existing_key) + print(f"'{existing_key}' has been returned.") + + elif choice == 4: + for Book, Situtation in library.items(): + print(f"Book: {Book}, Situtation: {Situtation}") + print(f"Total Books: {len(library)}") + print(f"Borrowed Books: {len(borrowed_books)}") + print(f"Available Books: {len(library) - len(borrowed_books)}") + + elif choice == 5: + print("Exit done.") + break + + else: + print("Invalid selection, try again.") +