I currently am using the following code to read in a string of integers separated by spaces as integers:
temp = input().split()
array =[]
for i in range(len(temp)):
array.append(int(temp[i]))
it seems like there should be a more efficient way to do it. Is there? If so how?