-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHRLists.py
More file actions
35 lines (25 loc) · 746 Bytes
/
Copy pathHRLists.py
File metadata and controls
35 lines (25 loc) · 746 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
if __name__ == '__main__':
N = int(input())
mylist = []
for _ in range(N):
command_line = input() # Komutu satır satır oku
parts = command_line.split() # Komutu ve parametreleri ayır
command = parts[0] # Komut adı
if command == "insert":
i = int(parts[1])
e = int(parts[2])
mylist.insert(i, e)
elif command == "print":
print(mylist)
elif command == "remove":
e = int(parts[1])
mylist.remove(e)
elif command == "append":
e = int(parts[1])
mylist.append(e)
elif command == "sort":
mylist.sort()
elif command == "pop":
mylist.pop()
elif command == "reverse":
mylist.reverse()