python
a = int(input('Введите первое число: '))
b = int(input('Введите второе число: '))
if abs(a) > abs(b):
a /= 2
b /= 2
print(a)
print(b)
import typing
from typing import Callable
from typing import AnyStr
from typing import Any
from typing import Iterable
from typing import List
--- Python 3.8.3 ---
def ListTransform(Data: List[Any], Tranformer: Callable[[Any], bool], Selector: Callable[[Any], bool] = None):
temp = Data.copy()
if Selector != None:
for index, item in enumerate(Data):
if (Selector(item)):
temp[index] = Tranformer(item)
else:
return temp
def main():
a, b = [float(input()) for _ in range(2)]
if (abs(a) > abs(b)):
a, b = ListTransform([a,b], lambda Item: Item / 2)
print(a,b)
Объяснение:
python
a = int(input('Введите первое число: '))
b = int(input('Введите второе число: '))
if abs(a) > abs(b):
a /= 2
b /= 2
print(a)
print(b)
import typing
from typing import Callable
from typing import AnyStr
from typing import Any
from typing import Iterable
from typing import List
--- Python 3.8.3 ---
def ListTransform(Data: List[Any], Tranformer: Callable[[Any], bool], Selector: Callable[[Any], bool] = None):
temp = Data.copy()
if Selector != None:
for index, item in enumerate(Data):
if (Selector(item)):
temp[index] = Tranformer(item)
else:
for index, item in enumerate(Data):
temp[index] = Tranformer(item)
return temp
def main():
a, b = [float(input()) for _ in range(2)]
if (abs(a) > abs(b)):
a, b = ListTransform([a,b], lambda Item: Item / 2)
print(a,b)
Объяснение: