diff --git a/Homework1 b/Homework1 new file mode 100644 index 0000000..b884221 --- /dev/null +++ b/Homework1 @@ -0,0 +1,27 @@ +from math import sqrt + +def check_Circles(c1_c, c1_r, c2_c, c2_r): + if(c1_c == c2_c and c1_r == c2_r): + return "Matching" + c1_x, c1_y = c1_c + c2_x, c2_y = c2_c + + distance = sqrt((c2_y - c1_y)**2 + (c2_x - c1_x)**2) + + if(c1_r + c2_ < distance): + return "not intersecting" + if(c1_r + c2_r == distance): + return "touching" + if(c1_r + c2_r > distance): + if(distance + c1_r <= c2_r): + if(c1_r + distance == c2_r): + return "Circle B contains circle A and they are touching" + else: + return "Circle B contains circle A" + elif(distance + c2_r <= c1_r): + if(c1_r == c2_r + distance): + return "Circle A contains circle B and they are touching" + else: + return "Circle A contains circle B" + else: + return "Intersecting" diff --git a/README.md b/README.md index 6f0f136..2cef8dc 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ $ marp 01.md && open 01.html |9| Елена Върбанова | [elenavarbanova](https://github.com/elenavarbanova) | | | |10| Златина Лилова | [zlatililova](https://github.com/zlatililova) | | | |11| Иваело Кръстев | [Ivaelo](https://github.com/Ivaelo) | | | -|12| Ивайло Димов | [IvailoDimov](https://github.com/IvailoDimov) | | | +|12| Ивайло Димов | [IvailoDimov](https://github.com/IvailoDimov) 🍬| | | |13| Ивайло Генчев | [Squidfishrl](https://github.com/Squidfishrl) | | | |14| Иван Станчев | [IvanStanchev](https://github.com/IvanStanchev) | 🍬 | | |15| Йордан Христов | [dachkata555](https://github.com/dachkata555) | | | diff --git a/hw2 b/hw2 new file mode 100644 index 0000000..335e866 --- /dev/null +++ b/hw2 @@ -0,0 +1,17 @@ +def fib(i): + if i == 2: + return i + return fib(i-1) + fib(i-2) + + +def num_ways(N): + if N <= 1: + return "ERROR" + if N > 2 + return "ERROR" + if N == 2: + return N + return fib(N) + + +print(num_ways(3))