Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homework_2 #100

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
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
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) | 🍬🍬🍬 | |

43 changes: 43 additions & 0 deletions homeworks/20_Nikolay_Lazarov/ 01_check_circles.py
Original file line number Diff line number Diff line change
@@ -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)
20 changes: 20 additions & 0 deletions homeworks/20_Nikolay_Lazarov/Homework_2/task3.py
Original file line number Diff line number Diff line change
@@ -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)
19 changes: 14 additions & 5 deletions materials/02/python_intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` са функции :)
Expand Down