I need to emulate a do-while loop in a Python program. Unfortunately, the following straightforward code does not work:
list_of_ints = [ 1, 2, 3 ] iterator =
Python 3.8 has the answer.
It's called assignment expressions. from the documentation:
# Loop over fixed length blocks while (block := f.read(256)) != '': process(block)