You are viewing a single comment's thread. Return to all comments →
if __name__ == '__main__': lst = [] N = int(input()) for _ in range(N): command, *nums = input().split() num = list(map(int,nums)) match command: case 'insert': i,e = num lst.insert(i, e) case 'print': print(lst) case 'remove': lst.remove(*num) case 'append': lst.append(*num) case 'sort': lst.sort() case 'pop': lst.pop() case 'reverse': lst.reverse() case _: print('Wrong command.') break
Seems like cookies are disabled on this browser, please enable them to open this website
Lists
You are viewing a single comment's thread. Return to all comments →