Use of a variable in parent loop
Stephane Tougard
stephane at sdf.org
Mon Sep 28 01:38:08 EDT 2020
On 2020-09-28, MRAB <python at mrabarnett.plus.com> wrote:
> It's used where the language requires a statement.
>
> In, say, C, you would use empty braces:
>
> while (process_next_item()) {
> /* Do nothing. */
> }
If I want to express nothing in C, I put nothing and it works fine.
#include <stdio.h>
int main(int argc, char * argv[])
{
if(1 == 1)
;
printf("Hello\n");
return 0;
}
> while process_next_item():
> # Do nothing.
> pass
while p():
# do nothing
continue
More information about the Python-list
mailing list