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