r/learnpython•
MulattoMilo

End loop at end of input

So, I'm a newb and I'm doing the practice problems at Codeabbey.com in my free time. I'm stuck on one of them and I can't figure out how to get passed it.

What I need to know is:

If I have a list like

14 1

42 2

43 4

99 0

I want to keep reading each one, line by line. I'm using a while loop to do so, but how do I keep the loop going and stopping when there's no more lines for input?

Posted Dec 2, 2015, 10:45 PM UTC

121
Loading comments…