I want to take unknown number of positive and negative integer number from user. The input will stop when the user press the Enter key.
For example -
If an user enter 1 2 3 4 5 -9 -10 1000 -Enter Key-
then it will store "1 2 3 4 5 -9 -10 1000"
Here is my tried code -
a = []
inp = input()
while inp != "\n":
a.append(inp)
inp = input()
print(a)
But this is not stop taking input even after pressing Enter Key.
Edit - This question asked for taking input until empty input but my question is taking input in one line until user press Enter button.