Advertisement
palmux

PythonPillola #13.1

Jul 19th, 2024
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | Source Code | 0 0
  1. import asyncio
  2.  
  3. async def saluta(nome):
  4.     print(f"Ciao, {nome}!")
  5.     await asyncio.sleep(1)
  6.     print(f"Arrivederci, {nome}!")
  7.  
  8. async def main():
  9.     await asyncio.gather(
  10.         saluta("Dee"),
  11.         saluta("Kiki"),
  12.         saluta("Bolla")
  13.     )
  14.  
  15. asyncio.run(main())
Tags: python pillola
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement