B
B
badproger12years2020-05-25 00:49:09
Python
badproger12years, 2020-05-25 00:49:09

Keyboard entry of a list of a certain length?

I've been learning python a little and I have a question. On the first line, the number N is given, which indicates the amount of input data in the second line of the number, separated by a space of which there are only N and they are added to the list. for example
3
1 2 3
the question arose, how to count N values ​​into a list?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
szafranji, 2020-05-25
@badproger12years

array = input().split()
You enter a list of any length without the first value N.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question