Challenge: Coroutines Under the Hood

Solve a challenge regarding coroutines under the hood.

We'll cover the following

Problem

The function starts at the beginning with a field called a label set to 0 and prints Before. Write the missing code so we can set the label to the next state before each suspension point. Also, specify a delay of one second and print After between the suspension and resumption.

Restriction

The output will be available in the terminal.

Output

The output will be as follows. Here, we will see a delay of one second.

Get hands-on with 1200+ tech skills courses.