How can I read N int
s from the input, and stop reading when I find \n
? Also, how can I add them to an array that I can work with?
I'm looking for something like this from C but in python
while(scanf("%d%c",&somearray[i],&c)!=EOF){
i++;
if (c == '\n'){
break;
}
}