Untitled
unknown
plain_text
a year ago
149 B
1
Indexable
def swap(lst): for i in range(0, len(lst)-1, 2): lst[i], lst[i+1] = lst[i+1], lst[i] list=eval(input()) swap(list) print(list)
Editor is loading...
Leave a Comment
def swap(lst): for i in range(0, len(lst)-1, 2): lst[i], lst[i+1] = lst[i+1], lst[i] list=eval(input()) swap(list) print(list)