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
Binary file added .DS_Store
Binary file not shown.
38 changes: 38 additions & 0 deletions python/src/codewars.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 1 задание
def EvenOrOdd(n):
if n % 2 == 0:
return 'Even'
return 'Odd'
# 2 zadanie
def count_sheeps(sheep):
a = 0
for i in sheep:
if i == True:
a += 1
return a
# 3 zadanie
def monkey_count(n):
return [x for x in range(1, n+1)]
#4 zadanie
def paperwork(n, m):
return n * m if n > 0 and m > 0 else 0
#5 zadanie
bulletsNeeded = dragons * 2;
if bullets >= bulletsNeeded:
return True;
else:
return False;
#6 zadanie
def correct_polish_letters(st):
return st.translate(str.maketrans("ąćęłńóśźż", "acelnoszz"))
#7 zadanie
def find_all(array, n):
res = []
for i in range(len(array)):
if array[i] == n:
res.append(i)
return res

#8 zadanie
def sum_of_minimums(numbers):
return sum([min(x) for x in numbers])
6 changes: 6 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Денисов Арсений
x=3.5
a=float(-2.5)
b=float(3.4)
while 3.5<= x <=6.5: