Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
pmbhatiya authored Mar 14, 2020
1 parent 3c9e5e3 commit 1f2312f
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Lists.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#Lists problem of Python Hackerarank
array = []
for _ in range(int(input())):
command = input().strip().split(" ")
cmd_type = command[0]
if (cmd_type == "print"):
print(array)
elif (cmd_type == "sort"):
array.sort()
elif (cmd_type == "reverse"):
array.reverse()
elif (cmd_type == "pop"):
array.pop()
elif (cmd_type == "remove"):
array.remove(int(command[1]))
elif (cmd_type == "append"):
array.append(int(command[1]))
elif (cmd_type == "insert"):
array.insert(int(command[1]), int(command[2]))

0 comments on commit 1f2312f

Please sign in to comment.