Middle Values
Sometimes you only need the center values from small lists. Write a function middle_way that takes two lists a and b, each with exactly 3 numbers. Return a new list with two elements: first the middle element of a, then the middle element of b.
Примеры
Ввод
[1, 2, 3], [4, 5, 6]Вывод
[2, 5]Ввод
[7, 7, 7], [3, 8, 0]Вывод
[7, 8]Ввод
[5, 2, 9], [1, 4, 5]Вывод
[2, 4]Нужно реализовать
def middle_way(a: list[int], b: list[int]) -> list[int]:
Теги
listsarray
Logáil isteach chun stair na n-aighneachtaí a fheiceáil
Logáil isteachLogáil isteach chun an Meantóir IS a úsáid
Logáil isteachVisible tests
1
Input
[1,2,3], [4,5,6]Expected
[2,5]2
Input
[7,7,7], [3,8,0]Expected
[7,8]3
Input
[5,2,9], [1,4,5]Expected
[2,4]4
Input
[0,0,0], [0,0,0]Expected
[0,0]5
Input
[1,1,1], [2,2,2]Expected
[1,2]6
Input
[1,1,1], [2,2,2,2]Expected
[1,2]Focus radio
Paused · SomaFM · Fluid