Напишите пж на пайтоне!pyton

Приложения:

Ответы

Ответ дал: Greenow
0

# python 3+

# предыдущее задание до изменения поста:

x = list(map(int, [input() for i in range(4)]))

if sum(x) % 3 == 0 and sum(x) % 2 == 0: print("не будет")

else: print("будет")

# первое задание

x = list(map(int, [input() for i in range(2)]))

prediction = 0

while True:

   if x[len(x)-1] == 0 and x[len(x)-2] == 0 and len(x) % 2 == 0: break

   x.append(int(input()))

alice = x[slice(0, len(x), 2)]

dad = x[slice(1, len(x), 2)]

for element in range(len(alice)):

   if alice[element] < dad[element]: prediction += 1

print(prediction)

# второе задание:

x = int(input())

day = 1

tails = 1

while tails <= x:

   day += 1

   tails = tails + (2 * day - 1)

print(day)

# третье задание:

from functools import reduce

print(reduce(lambda x, y: x*y, [i for i in range(int(input()), 1, -3)]))

# если у тебя есть вопросы по поводу кода, ты можешь написать их в коментариях, и я тебе отвечу! удачи)

Вас заинтересует