MT
list_ = list(map(int, input().split()))
for i in range(0, len(list_) - 1, 2):
list_[i], list_[i + 1] = list_[i + 1], list_[i]
print(list_)
Size: a a a
MT
list_ = list(map(int, input().split()))
for i in range(0, len(list_) - 1, 2):
list_[i], list_[i + 1] = list_[i + 1], list_[i]
print(list_)
MT
K
БГ
БГ
list(map(int, input().split()))
[*map(int, input().split()]
ЮЧ
G
VA
Python3
from itertools import zip_longest
l = [1,2,3,4,5,6,7]
nl = []
for a, b in zip_longest(l[::2], l[1::2]):
if b:
nl.append(b)
if a:
nl.append(a)
print(nl)
[2, 1, 4, 3, 6, 5, 7]
VA
G
S
G
G
VA
G
VA
G
M
AM