diff --git a/README.md b/README.md index 6f0f136..d1941c5 100644 --- a/README.md +++ b/README.md @@ -38,27 +38,29 @@ $ marp 01.md && open 01.html |Номер| Име | Github | Бонбони | Отсъствия | |-----|-----|--------|---------|-----------| |1| Авигея Илиева | [AI18527](https://github.com/AI18527) | | | +|2| Адриан Янковски | [adrianyankovski](https://github.com/adrianyankovski) | | | |3| Алекс Гечовски | [AlexGechovski](https://github.com/AlexGechovski) | | | |4| Александра Станчева | [allks12](https://github.com/allks12) | | | -|5| Боряна Стефанова| [Boryana23](https://github.com/Boryana23) | | | +|5| Боряна Стефанова| [Boryana23](https://github.com/Boryana23) |🍬🍬| | |6| Валентин Найденов| [valentinmnaydenov](https://github.com/valentinmnaydenov) | | | |7| Данаил Божков | [DBozhkovV](https://github.com/DBozhkovV) |🍬🍬🍬 | | -|8| Даниел Паунов | [McAwesome123](https://github.com/McAwesome123) | | | -|9| Елена Върбанова | [elenavarbanova](https://github.com/elenavarbanova) | | | -|10| Златина Лилова | [zlatililova](https://github.com/zlatililova) | | | +|8| Даниел Паунов | [McAwesome123](https://github.com/McAwesome123) | 🍬 | | +|9| Елена Върбанова | [elenavarbanova](https://github.com/elenavarbanova) | 🍬🍬 | | +|10| Златина Лилова | [zlatililova](https://github.com/zlatililova) | 🍬🍬🍬🍬| | |11| Иваело Кръстев | [Ivaelo](https://github.com/Ivaelo) | | | -|12| Ивайло Димов | [IvailoDimov](https://github.com/IvailoDimov) | | | -|13| Ивайло Генчев | [Squidfishrl](https://github.com/Squidfishrl) | | | -|14| Иван Станчев | [IvanStanchev](https://github.com/IvanStanchev) | 🍬 | | +|12| Ивайло Димов | [IvailoDimov](https://github.com/IvailoDimov) |🍬 | | +|13| Ивайло Генчев | [Squidfishrl](https://github.com/Squidfishrl) | 🍬🍬🍬 | | +|14| Иван Станчев | [IvanStanchev](https://github.com/IvanStanchev) | 🍬🍬 | | |15| Йордан Христов | [dachkata555](https://github.com/dachkata555) | | | -|16| Калин Георгиев | [kgeorgiev77](https://github.com/kgeorgiev77) | 🍬 | | +|16| Калин Георгиев | [kgeorgiev77](https://github.com/kgeorgiev77) | 🍬🍬🍬🍬 | | |17| Кристиан Косев | [Grozdi](https://github.com/Grozdi) | | | -|18| Лъчезар Велинов | [Lachezar-Velinov](https://github.com/Lachezar-Velinov) | 🍬 | | +|18| Лъчезар Велинов | [Lachezar-Velinov](https://github.com/Lachezar-Velinov) | 🍬🍬 | | |19| Лъчезар Лазаров | [LachezarLazarov](https://github.com/LachezarLazarov) | | | -|20| Мартин Златанов | [MartinZlatanov1](https://github.com/MartinZlatanov1) |🍬 | | -|21| Николай Лазаров| [NikolayLazarov](https://github.com/NikolayLazarov) |🍬🍬 | | +|20| Мартин Златанов | [MartinZlatanov1](https://github.com/MartinZlatanov1) |🍬🍬 | | +|21| Николай Лазаров| [NikolayLazarov](https://github.com/NikolayLazarov) |🍬🍬🍬🍬 | | |22| Пламен Цоков | [PlamenTs18](https://github.com/PlamenTs18) | | | |23| Симеон Христов | [ItzNinjaCat](https://github.com/ItzNinjaCat) |🍬🍬 | | |24| Станислав Иванов | [Stanislav04](https://github.com/Stanislav04) | | | |25| Явор Пачеджиев| [yavor2](https://github.com/yavor2) | 🍬 | | |26| Ясен Ефремов | [YassenEfremov](https://github.com/YassenEfremov) | 🍬🍬🍬 | | + diff --git a/homeworks/20_Nikolay_Lazarov/ 01_check_circles.py b/homeworks/20_Nikolay_Lazarov/ 01_check_circles.py new file mode 100644 index 0000000..9c81717 --- /dev/null +++ b/homeworks/20_Nikolay_Lazarov/ 01_check_circles.py @@ -0,0 +1,43 @@ +import math + +def take_distance(point1, point2): + a = point1[0] - point2[0] + + b = point1[1] - point2[1] + return math.sqrt( a*a + b*b) + +def check_containment(c1_center,c2_center,c1_raduis,c2_radius): + flag = True + if not c1_raduis > 2*c2_radius: + + flag = False + elif not c1_raduis - c1_center[0]> c2_radius - c2_center[0]: + flag = False + elif not c1_raduis - c1_center[1]> c2_radius - c2_center[1]: + flag = False + + return flag + +def check_circles(c1_center,c2_center,c1_raduis,c2_radius): + if c1_center == c2_center and c1_raduis == c2_radius: + return "MATCHING" + + elif check_containment(c1_center,c2_center,c1_raduis,c2_radius) == True or check_containment(c2_center,c1_center,c2_radius,c1_raduis) == True: + return "CONTAINING" + else: + if (c1_raduis + c2_radius) < take_distance(c1_center,c2_center): + return "NOTCOMMON" + elif (c1_raduis + c2_radius) == take_distance(c1_center,c2_center): + return "TOUCHING" + elif (c1_raduis + c2_radius) > take_distance(c1_center,c2_center): + return "INTERSECTING" + + + +circle1_cordinates = (2,2) +circle2_cordinates = (0,0) + + +answer = check_circles(circle1_cordinates,circle2_cordinates, 2, 5) + +print (answer) diff --git a/homeworks/20_Nikolay_Lazarov/Homework_2/task3.py b/homeworks/20_Nikolay_Lazarov/Homework_2/task3.py new file mode 100644 index 0000000..dcd6104 --- /dev/null +++ b/homeworks/20_Nikolay_Lazarov/Homework_2/task3.py @@ -0,0 +1,20 @@ +list1 = [ 'a', 1, [ ['a', 'b'], 1], ([1, 3, 'a'], 'b')] +def replace(list_values, find, replacement): + + for i in range(len(list_values)) : + if (list_values[i]==find): + list_values[i] = replacement + + if( isinstance(list_values[i],(list,str,tuple)) == True and len(list_values[i])>1): + if(type(list_values[i]) is tuple): + temp_list = list(list_values[i]) + temp_list = replace(temp_list,find,replacement) + list_values[i] = tuple(temp_list) + else: + list_values[i] = replace(list_values[i],find,replacement) + + return list_values + +rep = replace(list1,'b','c') + +print(rep) diff --git a/materials/02/python_intro.md b/materials/02/python_intro.md index 8373bdf..d9a8253 100644 --- a/materials/02/python_intro.md +++ b/materials/02/python_intro.md @@ -333,11 +333,20 @@ for i in range(20, 0, -3): - работят като навсякъде - работят върху най-вътрешния цикъл, ако има вложени --- -# `switch/case` -- ? ---- -# `switch/case` -- няма :) +# `match/case` +``` +match x: + case 5: + print("integer") + case "Hello": + print("string") + case True: + print("boolean") + case default: + print(f"x is {default}") +``` +[Виж повече](match.md) + --- # Функции Функциите в `python` са функции :)