coroutines python code example
Example 1: asyncio sleep
#will sleep the current corutien for set numner of seconds
import asyncio
await asyncio.sleep(1)
Example 2: coroutines in python
def randn():
time.sleep(3)
return randint(1, 10)
#will sleep the current corutien for set numner of seconds
import asyncio
await asyncio.sleep(1)
def randn():
time.sleep(3)
return randint(1, 10)