Python Do While Example. It makes a semicolon needed after the macro, providing a more function-like appearance for simple parsers and programmers as well as avoiding the scoping problem with if. Note: In a do...while loop the condition is tested AFTER executing the statements within the loop.