From de3a82a0904f814a66c543b1f1be75e723d00463 Mon Sep 17 00:00:00 2001 From: "Eng.Mokhtar Alahdal" <58419254+alahdalmokhtar@users.noreply.github.com> Date: Wed, 16 Apr 2025 20:46:58 +0200 Subject: [PATCH 1/5] creat --- week2.py | 0 week2_vragen.ipynb | 68 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 week2.py create mode 100644 week2_vragen.ipynb diff --git a/week2.py b/week2.py new file mode 100644 index 0000000..e69de29 diff --git a/week2_vragen.ipynb b/week2_vragen.ipynb new file mode 100644 index 0000000..366c562 --- /dev/null +++ b/week2_vragen.ipynb @@ -0,0 +1,68 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 5, + "id": "0222acb3", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ali Salem : 79.33\n", + "Ahmed Ali : 90.00\n", + "Sara Ahmed : 83.33\n", + "Hassan Mohamed : 80.00\n", + "Fatima Ali : 91.67\n", + "Omar Khaled : 80.00\n", + "Laila Ahmed : 90.00\n", + "Salem Ali : 82.33\n", + "Mona Ahmed : 85.33\n", + "Youssef Mohamed : 78.00\n" + ] + } + ], + "source": [ + "#q 1 : \n", + "students={\n", + " 'Ali Salem' : [80,70,88],\n", + " 'Ahmed Ali' : [90,85,95],\n", + " 'Sara Ahmed ': [78,82,90],\n", + " 'Hassan Mohamed ': [85,80,75],\n", + " 'Fatima Ali' : [92,88,95],\n", + " 'Omar Khaled' : [75,80,85],\n", + " 'Laila Ahmed' : [88,90,92],\n", + " 'Salem Ali': [80,90,77],\n", + " 'Mona Ahmed ' : [90,80,86],\n", + " 'Youssef Mohamed': [88,69,77]\n", + "}\n", + "GPA = 0\n", + "for student, grades in students.items():\n", + " GPA = sum(grades) / len(grades)\n", + " print(f\"{student} : {GPA:.2f}\")\n" + ] + } + ], + "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.10.11" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} From bf854a3870e047612a60ca49db082e4de6b1214e Mon Sep 17 00:00:00 2001 From: "Eng.Mokhtar Alahdal" <58419254+alahdalmokhtar@users.noreply.github.com> Date: Sat, 19 Apr 2025 01:13:05 +0200 Subject: [PATCH 2/5] All Done --- weeek2.ipynb | 554 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 554 insertions(+) create mode 100644 weeek2.ipynb diff --git a/weeek2.ipynb b/weeek2.ipynb new file mode 100644 index 0000000..5f999be --- /dev/null +++ b/weeek2.ipynb @@ -0,0 +1,554 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 2, + "id": "dcf84ad0", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ali Salem : 72.67\n", + "Ahmed Ali : 78.33\n", + "Sara Ahmed : 73.33\n", + "Hassan Mohamed : 68.33\n", + "Fatima Ali : 80.67\n", + "Omar Khaled : 65.00\n", + "Laila Ahmed : 79.00\n", + "Salem Ali : 82.33\n", + "Mona Ahmed : 73.67\n", + "Youssef Mohamed : 78.00\n", + "\n", + "====================\n", + " The studen after adding the GPA to the dictionary:\n", + "Ali Salem : [80, 50, 88, 72.66666666666667]\n", + "Ahmed Ali : [90, 50, 95, 78.33333333333333]\n", + "Sara Ahmed : [78, 82, 60, 73.33333333333333]\n", + "Hassan Mohamed : [50, 80, 75, 68.33333333333333]\n", + "Fatima Ali : [92, 55, 95, 80.66666666666667]\n", + "Omar Khaled : [60, 50, 85, 65.0]\n", + "Laila Ahmed : [55, 90, 92, 79.0]\n", + "Salem Ali : [80, 90, 77, 82.33333333333333]\n", + "Mona Ahmed : [55, 80, 86, 73.66666666666667]\n", + "Youssef Mohamed : [88, 69, 77, 78.0]\n", + "\n", + " ==============\n", + " the student with the hightest GPA is Salem Ali with GPA is : 82.33\n", + "\n", + " ==============\n", + " The students list with thier first name and last name:\n", + " Ali, Salem\n", + " Ahmed, Ali\n", + " Sara, Ahmed\n", + " Hassan, Mohamed\n", + " Fatima, Ali\n", + " Omar, Khaled\n", + " Laila, Ahmed\n", + " Salem, Ali\n", + " Mona, Ahmed\n", + " Youssef, Mohamed\n", + "\n", + " ==============\n", + " the student list sorted in alphabetical order : \n", + "Ahmed,Ali\n", + "Ali,Salem\n", + "Fatima,Ali\n", + "Hassan,Mohamed\n", + "Laila,Ahmed\n", + "Mona,Ahmed\n", + "Omar,Khaled\n", + "Salem,Ali\n", + "Sara,Ahmed\n", + "Youssef,Mohamed\n", + "\n", + " ==============\n", + " The student with GPA below 70 is :\n", + "Omar Khaled : [60, 50, 85, 65.0]\n", + "Hassan Mohamed : [50, 80, 75, 68.33333333333333]\n" + ] + } + ], + "source": [ + "#q 1 : \n", + "students={\n", + " 'Ali Salem' : [80,50,88],\n", + " 'Ahmed Ali' : [90,50,95],\n", + " 'Sara Ahmed ': [78,82,60],\n", + " 'Hassan Mohamed ': [50,80,75],\n", + " 'Fatima Ali' : [92,55,95],\n", + " 'Omar Khaled' : [60,50,85],\n", + " 'Laila Ahmed' : [55,90,92],\n", + " 'Salem Ali': [80,90,77],\n", + " 'Mona Ahmed ' : [55,80,86],\n", + " 'Youssef Mohamed': [88,69,77]\n", + "}\n", + "#q 2 :\n", + "# 1. Calculate the average GPA for each student and add it to the dictionary.\n", + "GPA = 0\n", + "for student, grades in students.items():\n", + " GPA = sum(grades) / len(grades)\n", + " print(f\"{student} : {GPA:.2f}\")\n", + "\n", + "#Add the GPA to the student dic:\n", + "print(\"\\n====================\")\n", + "print(\" The studen after adding the GPA to the dictionary:\")\n", + "for student,grade in students.items():\n", + " GPA = sum(grade) / len(grade)\n", + " students[student].append(GPA)\n", + " print(f\"{student} : {students[student]}\")\n", + " #the name with the GPA:\n", + " #print(f\" The GPA for {student} is : {students[student][-1]:.2f}\")\n", + "\n", + "# 2. Find the student with the highest GPA and print their name and GPA.\n", + "hightest_gpa=0\n", + "for student,grades in students.items():\n", + " GPA=sum(grades)/len(grades)\n", + " if GPA>hightest_gpa:\n", + " hightest_gpa=GPA\n", + " student_name=student\n", + "print(f\"\\n ==============\\n the student with the hightest GPA is {student_name} with GPA is : {hightest_gpa:.2f}\")\n", + "# 3. separate each student name from thier surname and print them in a new list.\n", + "students_list = []\n", + "for student in students.keys():\n", + " # clean the space in the dictionary:\n", + " #clean=student.strip()\n", + " \n", + " first_name,last_name=student.split()\n", + " students_list.append((first_name, last_name))\n", + "print(\"\\n ==============\\n The students list with thier first name and last name:\")\n", + "for first_name, last_name in students_list:\n", + " print(f\" {first_name}, {last_name}\")\n", + "#3 ====================================\n", + "#4. sort the names in the list in alphabetical order and printed the sorted list on screen.\n", + "students_list.sort(key=lambda x: x[0])\n", + "print(\"\\n ==============\\n the student list sorted in alphabetical order : \")\n", + "for first_name,last_name in students_list:\n", + " print(f\"{first_name},{last_name}\")\n", + "#===========================================================================\n", + "#5.keep students with gpa below 70 in a cluster(set).\n", + "list_of_students = set()\n", + "print(\"\\n ==============\\n The student with GPA below 70 is :\")\n", + "for student,grades in students.items():\n", + " GPA=sum(grades)/len(grades)\n", + " if GPA < 70:\n", + " list_of_students.add(student)\n", + "#=========== print(list_of_students) ==========\n", + "for student in list_of_students:\n", + " #print(student)\n", + " print(f\"{student} : {students[student]}\")\n", + "\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "e17ddac6", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "Welcome! Loaded 3 movies from storage.\n", + "\n", + "===== Movie Manager =====\n", + "1. Add Movie\n", + "2. Edit Movie\n", + "3. Delete Movie\n", + "4. View All Movies\n", + "5. Filter Movies\n", + "6. Exit\n", + "\n", + "Saving data... Goodbye!\n" + ] + } + ], + "source": [ + "###Question 2:\n", + "### All punts answering for Question num 2 in the code below \n", + "#1-2-3-4##.save the movie library to a fileandrestorethisdata when the program starts.\n", + "import os\n", + "\n", + "# File to store movie data (text format) :- TEXT FILE format \n", + "MOVIES_FILE = \"movies.txt\"\n", + "\n", + "def load_movies():\n", + " \"\"\"Load movies from text file if it exists.\"\"\"\n", + " movies = {}\n", + " if os.path.exists(MOVIES_FILE):\n", + " with open(MOVIES_FILE, 'r') as file:\n", + " for line in file:\n", + " # Split each line into components\n", + " parts = line.strip().split('|')\n", + " if len(parts) == 4: # Ensure valid format\n", + " name, director, year, genre = parts\n", + " movies[name] = {\n", + " 'director': director,\n", + " 'year': year,\n", + " 'genre': genre\n", + " }\n", + " return movies\n", + "\n", + "def save_movies(movies):\n", + " \"\"\"Save movies to text file in pipe-delimited format.\"\"\"\n", + " with open(MOVIES_FILE, 'w') as file:\n", + " for name, details in movies.items():\n", + " file.write(\n", + " f\"{name}|{details['director']}|\"\n", + " f\"{details['year']}|{details['genre']}\\n\"\n", + " )\n", + "#Added function to add:-\n", + "def add_movie(movies):\n", + " \"\"\"Add a new movie to the collection.\"\"\"\n", + " print(\"\\n--- Add New Movie ---\")\n", + " name = input(\"Movie title (or 'exit' to cancel): \")\n", + " if name.lower() == 'exit':\n", + " return\n", + " \n", + " director = input(\"Director: \")\n", + " year = input(\"Release year: \")\n", + " genre = input(\"Genre: \")\n", + " \n", + " movies[name] = {\n", + " 'director': director,\n", + " 'year': year,\n", + " 'genre': genre\n", + " }\n", + " save_movies(movies)\n", + " print(f\"\\n✅ '{name}' added successfully!\")\n", + "#Added function to edit :-\n", + "def edit_movie(movies):\n", + " \"\"\"Edit an existing movie's details.\"\"\"\n", + " print(\"\\n--- Edit Movie ---\")\n", + " name = input(\"Enter movie title to edit: \")\n", + " \n", + " if name in movies:\n", + " print(f\"\\nEditing: {name}\")\n", + " print(f\"Current director: {movies[name]['director']}\")\n", + " movies[name]['director'] = input(\"New director (press Enter to keep): \") or movies[name]['director']\n", + " \n", + " print(f\"\\nCurrent year: {movies[name]['year']}\")\n", + " movies[name]['year'] = input(\"New year (press Enter to keep): \") or movies[name]['year']\n", + " \n", + " print(f\"\\nCurrent genre: {movies[name]['genre']}\")\n", + " movies[name]['genre'] = input(\"New genre (press Enter to keep): \") or movies[name]['genre']\n", + " \n", + " save_movies(movies)\n", + " print(f\"\\n✅ '{name}' updated successfully!\")\n", + " else:\n", + " print(f\"\\n❌ Movie '{name}' not found!\")\n", + "#added function to delete :-\n", + "def delete_movie(movies):\n", + " \"\"\"Remove a movie from the collection.\"\"\"\n", + " print(\"\\n--- Delete Movie ---\")\n", + " name = input(\"Enter movie title to delete: \")\n", + " \n", + " if name in movies:\n", + " del movies[name]\n", + " save_movies(movies)\n", + " print(f\"\\n✅ '{name}' deleted successfully!\")\n", + " else:\n", + " print(f\"\\n❌ Movie '{name}' not found!\")\n", + "#Added function to display :-\n", + "def display_movies(movies, filter_type=None, filter_value=None):\n", + " \"\"\"Display movies with optional filtering.\"\"\"\n", + " print(\"\\n--- Movie Collection ---\")\n", + " print(\"\\n{:<30} {:<20} {:<10} {:<15}\".format(\n", + " \"TITLE\", \"DIRECTOR\", \"YEAR\", \"GENRE\"))\n", + " print(\"-\" * 75)\n", + " \n", + " if not movies:\n", + " print(\"No movies in collection yet!\")\n", + " return\n", + " ## filter movie by genre, year, or director:- \n", + " filtered_movies = {}\n", + " if filter_type and filter_value:\n", + " filter_value = filter_value.lower()\n", + " if filter_type == 'genre':\n", + " filtered_movies = {\n", + " k: v for k, v in movies.items() \n", + " if v['genre'].lower() == filter_value\n", + " }\n", + " elif filter_type == 'year':\n", + " filtered_movies = {\n", + " k: v for k, v in movies.items() \n", + " if v['year'] == filter_value\n", + " }\n", + " elif filter_type == 'director':\n", + " filtered_movies = {\n", + " k: v for k, v in movies.items() \n", + " if v['director'].lower() == filter_value\n", + " }\n", + " \n", + " display_list = filtered_movies if filtered_movies else movies\n", + " \n", + " for name, details in display_list.items():\n", + " ''' print(f\"\\n🎬 {name}\")\n", + " print(f\" Director: {details['director']}\")\n", + " print(f\" Year: {details['year']}\")\n", + " print(f\" Genre: {details['genre']}\")'''\n", + " print(\" 🎬 {:<30} {:<20} {:<10} {:<15}\".format(\n", + " name[:28] + ('..' if len(name) > 28 else ''),\n", + " details['director'][:18] + ('..' if len(details['director']) > 18 else ''),\n", + " details['year'],\n", + " details['genre'][:13] + ('..' if len(details['genre']) > 13 else '')))\n", + " \n", + " print(f\"\\nTotal movies: {len(display_list)}\")\n", + "## Main function to run the program:-\n", + "def main():\n", + " \"\"\"Main program loop.\"\"\"\n", + " movies = load_movies()\n", + " print(f\"\\nWelcome! Loaded {len(movies)} movies from storage.\")\n", + " \n", + " while True:\n", + " print(\"\\n===== Movie Manager =====\")\n", + " print(\"1. Add Movie\")\n", + " print(\"2. Edit Movie\")\n", + " print(\"3. Delete Movie\")\n", + " print(\"4. View All Movies\")\n", + " print(\"5. Filter Movies\")\n", + " print(\"6. Exit\")\n", + " \n", + " choice = input(\"\\nChoose an option (1-6): \")\n", + " \n", + " if choice == '1':\n", + " add_movie(movies)\n", + " elif choice == '2':\n", + " edit_movie(movies)\n", + " elif choice == '3':\n", + " delete_movie(movies)\n", + " elif choice == '4':\n", + " display_movies(movies)\n", + " elif choice == '5':\n", + " print(\"\\nFilter by:\")\n", + " print(\"1. Genre\")\n", + " print(\"2. Year\")\n", + " print(\"3. Director\")\n", + " filter_choice = input(\"Choose filter type (1-3): \")\n", + " \n", + " if filter_choice == '1':\n", + " genre = input(\"Enter genre to filter: \")\n", + " display_movies(movies, 'genre', genre)\n", + " elif filter_choice == '2':\n", + " year = input(\"Enter year to filter: \")\n", + " display_movies(movies, 'year', year)\n", + " elif filter_choice == '3':\n", + " director = input(\"Enter director to filter: \")\n", + " display_movies(movies, 'director', director)\n", + " else:\n", + " print(\"Invalid filter choice!\")\n", + " elif choice == '6':\n", + " print(\"\\nSaving data... Goodbye!\")\n", + " break\n", + " else:\n", + " print(\"Invalid option! Please choose 1-6.\")\n", + "## run the main function to start the program:-\n", + "if __name__ == \"__main__\":\n", + " main()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "87ec4a63", + "metadata": {}, + "outputs": [], + "source": [ + "###Question 3:\n", + "###punt 3 :-\n", + "\n", + "customer = {}\n", + "\"\"\"Handle Customer addition.\"\"\"\n", + "def add_customer( ):\n", + " ############# this function is used to add customer details .\n", + "\n", + " print(\"\\n=== Add New Customer ===\")\n", + " while True:\n", + " \n", + " try:\n", + " name = input(\"Customer title (or 'back' to return): \")\n", + " if name.lower() == 'back':\n", + " break\n", + " customer_id = int(input(\"Enter customer id :\"))\n", + " if customer_id in customer:\n", + " print(\"Customer ID already exists. Please enter a unique ID.\")\n", + " continue\n", + " customer_id = int(input(\"Enter customer id :\"))\n", + " first_name = input(\"Enter first name :\")\n", + " last_name = input(\"Enter last name :\")\n", + " email = input(\"Enter email :\")\n", + " phone_number = input(\"Enter phone number :\")\n", + " customer[customer_id] = {\n", + " 'first_name': first_name,\n", + " 'last_name': last_name,\n", + " 'email': email,\n", + " 'phone_number': phone_number\n", + " }\n", + " print(\" ✅ Customer added successfully!\")\n", + " view_customer()##calling to show details.\n", + " break\n", + " \n", + " except ValueError:\n", + " print(\"Invalid input. Please enter a valid customer ID.\")\n", + "\n", + " \n", + "##end of the function add_customer.\n", + "def view_customer():\n", + " if not customer:\n", + " print(\"No customers found.\")\n", + " else:\n", + " for customer_id, details in customer.items():\n", + " print(\"\\n the details of the customer are :\")\n", + " print(\"{:<30} {:<20} {:<10} {:<25} {:<15}\".format(\n", + " \"Customer ID\", \"First Name\", \"Last Name\", \"Email\", \"Phone Number\"))\n", + " print(\"-\" * 100)\n", + "\n", + " print(\"{:<30} {:<20} {:<10} {:<25} {:<15}\".format(\n", + " str(customer_id)[:28] + ('..' if len(str(customer_id)) > 28 else ''),\n", + " details['first_name'][:18] + ('..' if len(details['first_name']) > 18 else ''),\n", + " details['last_name'][:10] + ('..' if len(details['last_name']) > 10 else ''),\n", + " details['email'],\n", + " details['phone_number'][:10] + ('..' if len(details['phone_number']) > 10 else '')))\n", + " print(f\"\\nTotal Customer: {len(customer)}\")\n", + " ''''\n", + " print(\"-----------------------------\")\n", + " print(f\"Customer ID: {customer_id}\")\n", + " print(f\"First Name: {details['first_name']}\")\n", + " print(f\"Last Name: {details['last_name']}\")\n", + " print(f\"Email: {details['email']}\")\n", + " print(f\"Phone Number: {details['phone_number']}\")\n", + " print(\"-----------------------------\")'''\n", + "def del_customer():\n", + " print(\"\\n === Delete Movie ===\")\n", + " try:\n", + " customer_id = int(input(\"Enter customer id to delete :\"))\n", + " if customer_id in customer:\n", + " confirm = input(f\"Are you sure you want to delete '{customer_id}'? (y/n): \")\n", + " if confirm.lower() == 'y':\n", + "\n", + " del customer[customer_id]\n", + " print(f\"✅ {customer_id} : deleted successfully!\")\n", + " view_customer()##calling to show details.\n", + " else:\n", + " print(\" ❌ Customer not found.\")\n", + " except ValueError:\n", + " print(\"invalid inpt\")\n", + "#end of the function del_customer.\n", + "\n", + "def update_customer():\n", + " print(\"\\n ====show all customer details before updating====\")\n", + " \n", + " customer_id = int(input(\"Enter customer id to update :\"))\n", + " if customer_id in customer:\n", + " first_name = input(\"Enter new first name (leave blank to keep current): \")\n", + " last_name = input(\"Enter new last name (leave blank to keep current): \")\n", + " email = input(\"Enter new email (leave blank to keep current): \")\n", + " phone_number = input(\"Enter new phone number (leave blank to keep current): \")\n", + "\n", + " if first_name:\n", + " customer[customer_id]['first_name'] = first_name\n", + " if last_name:\n", + " customer[customer_id]['last_name'] = last_name\n", + " if email:\n", + " customer[customer_id]['email']=email\n", + " if phone_number:\n", + " customer[customer_id]['phone_number'] = phone_number\n", + " print(\" Customer update successfully!\")\n", + " view_customer()##calling to show details.\n", + " else:\n", + " print(\" Customer not found.\")\n", + "##end of the function update_customer.\n", + "\n", + "def checkout_customer():\n", + " customer_id = int(input(\"Enter customer id to search : \"))\n", + " if customer_id in customer:\n", + " view_customer()\n", + " details = customer[customer_id]\n", + " print(\"\\n the details of the customer are :\")\n", + " print(\"-----------------------------\")\n", + " print(f\"Customer ID: {customer_id}\")\n", + " print(f\"First Name: {details['first_name']}\")\n", + " print(f\"Last Name: {details['last_name']}\")\n", + " print(f\"Email: {details['email']}\")\n", + " print(f\"Phone Number: {details['phone_number']}\")\n", + " print(\"-----------------------------\")\n", + " \n", + " else:\n", + " print(\"Customer not found.\")\n", + " ##end of the function checkout_customer.\n", + "\n", + "\n", + " ### the main function start from here . \n", + "def main():\n", + " print(\"Welcome to the customer management system \")\t\n", + "\n", + "while True:\n", + " print(\"please select an option from the menu below:\")\n", + " print(\"-------------------------------------------------\")\n", + " print(\"1 .Add customer\")\n", + " print(\"2 .view customer\")\n", + " print(\"3. delete customer\")\n", + " print(\"4.search customer\")\n", + " print(\"5.update customer\")\n", + " print(\"6 .exit\")\n", + " choice=input(\"Enter your choice :\")\n", + " if choice == '1':\n", + " add_customer()\n", + "\n", + " elif choice == '2':\n", + " view_customer()\n", + " \n", + "\n", + " elif choice == '3':\n", + " del_customer()\n", + " \n", + "\n", + " elif choice == '4':\n", + " checkout_customer() #call the function checkout_customer.\n", + " \n", + "\n", + " elif choice == '5':\n", + " update_customer()#call the function update_customer.\n", + " #\n", + " elif choice == '6':\n", + " print(\"Exiting the program.\")\n", + " break\n", + " else:\n", + " print(\"Invalid choice. Please try again.\")\n", + "\n", + "\n", + "##end the main function .\n", + "\n", + "## the main function is called here .\n", + "if __name__ ==\"__main__\":\n", + " pass\n", + " #main()" + ] + } + ], + "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.10.11" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} From 468a0f82384aa08055e1006abb3d416c14524f50 Mon Sep 17 00:00:00 2001 From: Alahdal <58419254+alahdalmokhtar@users.noreply.github.com> Date: Sat, 19 Apr 2025 01:21:41 +0200 Subject: [PATCH 3/5] Delete week2.py --- week2.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 week2.py diff --git a/week2.py b/week2.py deleted file mode 100644 index e69de29..0000000 From 2e38f710838299e6bda3fcb8e6e9e8b04324a2a0 Mon Sep 17 00:00:00 2001 From: Alahdal <58419254+alahdalmokhtar@users.noreply.github.com> Date: Sat, 19 Apr 2025 01:22:23 +0200 Subject: [PATCH 4/5] Delete week2_vragen.ipynb --- week2_vragen.ipynb | 68 ---------------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 week2_vragen.ipynb diff --git a/week2_vragen.ipynb b/week2_vragen.ipynb deleted file mode 100644 index 366c562..0000000 --- a/week2_vragen.ipynb +++ /dev/null @@ -1,68 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 5, - "id": "0222acb3", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Ali Salem : 79.33\n", - "Ahmed Ali : 90.00\n", - "Sara Ahmed : 83.33\n", - "Hassan Mohamed : 80.00\n", - "Fatima Ali : 91.67\n", - "Omar Khaled : 80.00\n", - "Laila Ahmed : 90.00\n", - "Salem Ali : 82.33\n", - "Mona Ahmed : 85.33\n", - "Youssef Mohamed : 78.00\n" - ] - } - ], - "source": [ - "#q 1 : \n", - "students={\n", - " 'Ali Salem' : [80,70,88],\n", - " 'Ahmed Ali' : [90,85,95],\n", - " 'Sara Ahmed ': [78,82,90],\n", - " 'Hassan Mohamed ': [85,80,75],\n", - " 'Fatima Ali' : [92,88,95],\n", - " 'Omar Khaled' : [75,80,85],\n", - " 'Laila Ahmed' : [88,90,92],\n", - " 'Salem Ali': [80,90,77],\n", - " 'Mona Ahmed ' : [90,80,86],\n", - " 'Youssef Mohamed': [88,69,77]\n", - "}\n", - "GPA = 0\n", - "for student, grades in students.items():\n", - " GPA = sum(grades) / len(grades)\n", - " print(f\"{student} : {GPA:.2f}\")\n" - ] - } - ], - "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.10.11" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} From be36cbd8645df476ad50a1b44ce06701205fceb5 Mon Sep 17 00:00:00 2001 From: MBanafea <203900813+MBanafea@users.noreply.github.com> Date: Sat, 19 Apr 2025 01:49:59 +0200 Subject: [PATCH 5/5] Update weeek2.ipynb --- weeek2.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weeek2.ipynb b/weeek2.ipynb index 5f999be..f8a23f6 100644 --- a/weeek2.ipynb +++ b/weeek2.ipynb @@ -144,7 +144,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "id": "e17ddac6", "metadata": {}, "outputs": [