fork download
  1. import asyncio
  2.  
  3. async def do_nothing():
  4. return
  5.  
  6. async def print_loop():
  7. for i in range(1, 50):
  8. print(i)
  9. await do_nothing()
  10.  
  11. asyncio.run(print_loop())
  12. asyncio.run(print_loop())
Success #stdin #stdout 0.08s 16076KB
stdin
Standard input is empty
stdout
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49