I have a programming assignment and all of the inputs that I need to enter are multilined. For example:
4 3
10 3
100 5
1000000000 8
or:
7 8 666
8 7 666
10 16 273
I am trying to convert the lines into lists. I can't use files and I need to be able to input them into the program using an input statement.
The problem I am having is, I want the output to be:
[['4', '3'], ['10', '3'], ['100', '5'], ['1000000000', '8']]
so I can use it to finish the rest of my program. But what I am getting is only:
[['4', '3']]
The code I have been trying to use is:
aString = input(" > ")
aString_list = [x for x in (y.split() for y in aString.split('\n')) if x]
print(aString_list)
I am confused on how to get it to read the other lines. Thanks.