We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Basic Data Types
- Lists
- Discussions
Lists
Lists
Sort by
recency
|
2868 Discussions
|
Please Login in order to post a comment
if name == 'main': l=[] l2=[] N=int(input()) for _ in range(N): l.append(input().split()) #print(l) for i in l: match i[0]: case "append": a,b=i l2.append(int(b)) case "insert": a,b,c=i l2.insert(int(b),int(c)) case "remove": a,b=i l2.remove(int(b)) case "pop": l2.pop() case "reverse": l2.reverse() case "sort": l2.sort() case "print": print(l2)
if name == 'main': N = int(input()) result=[] for i in range(N): commands= input().split()
if name == 'main': N = int(input()) l = list()