-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLists.py
43 lines (26 loc) · 877 Bytes
/
Lists.py
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
36
37
38
'''
Author: Aditya Mangal
Date: 23 september,2020
Purpose: python practise problem
'''
if __name__ == "__main__":
final_list = []
n = int(input())
for i in range(n):
user_input = input().split()
if user_input[0] == 'insert':
final_list.insert(int(user_input[1]), int(user_input[2]))
elif user_input[0] == 'print':
print(final_list)
elif user_input[0] == 'pop':
final_list.pop()
elif user_input[0]== 'sort':
final_list.sort()
elif user_input[0]== 'remove':
final_list.remove(int(user_input[1]))
elif user_input[0]== 'append':
final_list.append(int(user_input[1]))
elif user_input[0] == 'reverse':
final_list.reverse()
else:
print('Something gone wrong!')