Is there some way to take a set number of multiple inputs for a list in Python 3.7?
I tried this:
MyList=[int(x) for x in input().split(" ",N)]
when N is the number inputs I want. but whenever I try to run my code I get an error saying:
MyList=[int(x) for x in input().split(" ",N)]
File "<string>", line 1
1 2 3 4 5 6 7
^
SyntaxError: invalid syntax
The expected Input is:-
Suppose N=7,
1 2 3 4 5 6 7
This should make it a part of the list
MyList=[1,2,3,4,5,6,7]