List from input

Report a typo

Use the template below to write a program that takes n numbers as input, creates a list with them as elements, and then prints it.

The first number in the sample input shows how many elements your list should contain, i.e. its length. The numbers after it are the elements that you need to append to your list.

Tip: At this point, you may not know how to add elements to a list. You can use the command list.append(element) to do that, where list is the name of your list, and element is the name of the variable that you want to add to the list. Also, the pass statement is just a placeholder for your code, you can safely replace it.

Sample Input 1:

5
100
-1
72
0
0

Sample Output 1:

[100, -1, 72, 0, 0]
Write a program in Python 3
n = int(input())
for i in range(n):
pass
___

Create a free account to access the full topic