Skip to content
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
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/Informatics_2022.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Вот сюда нужно будет в первой работе с гитом добавит свое ФИО

## ФИО
## Демьяненко Матвей Александрович

## Работа с репозиторием

Expand Down
56 changes: 56 additions & 0 deletions python/src/codewar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import math

#task1
def even_or_odd(number):
if number % 2 == 0:
return "Even"
else:
return "Odd"
even_or_odd(10)


#task2
def count_sheeps(sheep):
return sheep.count(True)


#task3
def monkey_count(n):
result = []
for num in range(1, n + 1):
result.append(num)
return result
monkey_count(10)


#task4
def paperwork(n, m):
return n * m if n > 0 and m > 0 else 0
paperwork(10,16)


#task5
def hero(b, d):
bulletsneeded = d * 2
if b >= bulletsneeded:
return True
else:
return False
hero(30,10)

#task6
def correct_polish_letters(st):
pol=pol = {"ą": "a", "ć": "c", "ę": "e", "ł": "l", "ń": "n", "ó": "o", "ś": "s", "ź": "z", "ż": "z"}
return "".join([pol[c] if c in pol else c for c in st])

#task7
def find_all(array, n):
arr = []
for el in range(len(array)-1):
if array[el] == n:
arr.append(el)
return arr

#task8
def sum_of_minimums(numbers):
return sum(map(min, numbers))
49 changes: 44 additions & 5 deletions python/src/main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,46 @@
def summ(a: int, b: int) -> int:
return a + b
from codewar import *
import math

a = 4.1
b = 2.7

if __name__ == "__main__":
print("Hello world")
print(summ(3, 4))
def Y(x):
global a, b

return (a * (x ** 1/3) - b * math.log(x, 5)) / (math.log(x - 1, 10) ** 3)


# task №23 A
print("task №23 A")

x_first = 1.5
x_last = 3.5
step = 0.4

x = x_first
while x < x_last:
print(f"y({x}) = {Y(x)}")
x+=step


# task №23 B
print("task №23 B")

array_x = [1.9, 2.15, 2.34, 2.74, 3.16]
for x in array_x:
print(f"y({x}) = {Y(x)}")


print(even_or_odd(2))
print(count_sheeps([True, True, True, False,
True, True, True, True,
True, False, True, False,
True, False, False, True,
True, True, True, True,
False, False, True, True]))
print(monkey_count(5))
print(paperwork(10, 10))
print(hero(20, 5))
print(correct_polish_letters("Jędrzej Błądziński"))
print(sum_of_minimums([[7, 9, 8, 6, 2], [6, 3, 5, 4, 3], [5, 8, 7, 4, 5]]))
print(find_all([6, 9, 3, 4, 3, 82, 11], 3))