I'd like to type in my input from command lines after running
if __name__ == "__main__":
data = list(map(int, sys.stdin.readline().split()))
print(data)
n, capacity = data[0:2]
values = data[2:(2 * n + 2):2]
weights = data[3:(2 * n + 2):2]
A sample input could be:
2 40
20 2
30 3
My questions are:
1) How to create the list data using my input?
2) How can I let Python know I have finished the input and it should execute the rest of the code?