I know this is probably something incredibly simple, but I seem to be stumped. Anyways for an assignment I have to have the user enter the number of data points(N) followed by the data points themselves. They must then be printed in the same manner in which they were entered (one data point/line) and then put into a single list for later use. Here's what I have so far
N = int(input("Enter number of data points: "))
lines = ''
for i in range(N):
lines += input()+"\n"
print(lines)
output for n = 4 (user enters 1 (enter) 2 (enter)...4 and the following is printed:
1
2
3
4
So this works and looks perfect however I now need to convert these values into a list to do some statistics work later in the program. I have tried making a empty list and bringing lines into it however the /n formating seems to mess things up. Or I get list index out of range error. Any and all help is greatly appreciated!