I wrote the following code:
import asyncio
async def write_after(pause,text):
print('begin')
await asyncio.sleep(pause)
print(text)
async def main():
await write_after(1,'Hello...')
await write_after(2,'...world')
asyncio.run(main())
As result I got:
begin
Hello...
begin
...world
with pauses right after begins. I was wondering why result isn't:
begin
begin
Hello...
...world
like executing program that uses tasks.