You are viewing a single comment's thread. Return to all comments →
if __name__ == '__main__': N = int(input()) l = []`` for i in range(N): c = input() co = c.split() if co[0] == 'insert': l.insert(int(co[1]), int(co[2])) elif co[0] == 'print': print(l) elif co[0] == 'remove': l.remove(int(co[1])) elif co[0] == 'append': l.append(int(co[1])) elif co[0] == 'sort': l.sort() elif co[0] == 'pop':
l.pop() elif co[0] == 'reverse': l.reverse()
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 →