So, I am just trying to solve a problem on hackerrank.com
Here is my code:
if __name__ == '__main__':
N = int(input())
num_list = []
for numberOfCommands in range(N):
command , * numbers = input().split(" ")
numbers = [int(i) for i in numbers]
print(numbers)
if command == 'insert':
num_list.insert(numbers[0],numbers[1:])
elif command == 'print':
print(num_list)
else:
num_list.command(numbers[0])
The problem is when I print list
it prints nested lists. What I want is to creating a single list of int
s.