You are viewing a single comment's thread. Return to all comments →
I prefer this one too, I improved a little bit:
L = [] for i in range(N): s = input().split(" ") arg = list(map(int, s[1:])) if s[0] == 'insert': L.insert(*arg) elif s[0] == 'remove': L.remove(*arg) elif s[0] == 'append': L.append(*arg) elif s[0] == 'sort': L.sort() elif s[0] == 'pop': L.pop() elif s[0] == 'reverse': L.reverse() else: print(L)
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 →
I prefer this one too, I improved a little bit: