How to read an integer list from single line input along with a range in Python 3?
Requirement: reading integer values for a given list separated by a space from single line input but with a range of given size.
example:
Range = 4
Then list size = 4
Then read the input list from a single line of size 4
I tried below list comprehension statement, but it is reading a list from 4 lines [i.e creating 4 lists with each list representing values from a given line] instead of reading only 1 list with a size of 4
no_of_marks = 4
marksList = [list(int(x) for x in input().split()) for i in range(no_of_marks)]
Can someone help me in achieving my requirement?