3 ms·
I think I'll use this exactly to avoid duplication in while loops: bytes = next() while bytes: # do something ... bytes = next() It's
by mockingbirdy 8y ago
I think I'll use this exactly to avoid duplication in while loops:
bytes = next()
while bytes:
# do something ...
bytes = next()
It's possible to use while True and break, but that isn't very elegant.