Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
def read_ints():
i = 0
while True:
s = input('enter number[%i]:' % i)
yield int(s); i+=1
except ValueError:
if s == "": return
else: print "ignoring invalid number"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.