Create and Print List -3
You are given
The first line of input is an integer
In the given example,
N=4 and the numbers are 1, 2, 3, 4. So, the output should be [ 1, 2, 3, 4 ]
Sample Input 1
4
1
2
3
4
Sample Output 1
[1, 2, 3, 4]
Sample Input 2
3
13
21
19
Sample Output 2
[13, 21, 19]
N = int(input('Enter integer here: '))
list1 = []
for i in range(N):
n = int(input('Enter numbers here: '))
list1.append(n)
print(list1)
Enter integer here: 4
Enter numbers here: 1
Enter numbers here: 2
Enter numbers here: 3
Enter numbers here: 4
[1, 2, 3, 4]
Comments
Leave a comment