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

выполнено задание по codewars #200

Open
wants to merge 2 commits into
base: Kostina_Anastasija_Evgenevna
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
2 changes: 1 addition & 1 deletion python/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ mypy = "*"
flake8 = "*"

[requires]
python_version = "3.9"
python_version = "3.11"

[scripts]
start = "python ./src/main.py"
Expand Down
70 changes: 70 additions & 0 deletions python/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,76 @@ def summ(a: int, b: int) -> int:
return a + b


def sum_of_minimums(numbers):
result = 0
for i in range(len(numbers)):
minimum = None
for j in range(len(numbers[0])):
if (minimum is None or minimum > numbers[i][j]):
minimum = numbers[i][j]
result += minimum
return result


def find_all(array, n):
result = []
for idx, element in enumerate(array):
if element == n:
result.append(idx)
return result


def correct_polish_letters(st):
st = st.replace('ą', 'a')
st = st.replace('ć', 'c')
st = st.replace('ę', 'e')
st = st.replace('ł', 'l')
st = st.replace('ń', 'n')
st = st.replace('ó', 'o')
st = st.replace('ś', 's')
st = st.replace('ź', 'z')
st = st.replace('ż', 'z')
return st


def paperwork(n, m):
if n < 0 or m < 0:
return 0
else:
return n * m


def monkey_count(n):
count = []
for i in range(n):
count.append(i + 1)
return count


def hero(bullets, dragons):
if bullets < dragons * 2:
return False
else:
return True


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


def count_sheeps(sheep):
if sheep is not None:
answer = 0
for item in sheep:
if item:
answer += 1
return answer
return 0


if __name__ == "__main__":
print("Hello world")
print(summ(3, 4))