Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Challenge: Async Web Request Simulator | Asynchronous Programming (asyncio)
Python Structural Programming
Section 4. Chapitre 4
single

single

Challenge: Async Web Request Simulator

Glissez pour afficher le menu

Tâche

Glissez pour commencer à coder

Your task is to implement an asynchronous function to simulate web requests using the asyncio library.

  • Complete the simulate_web_request coroutine to:
    • Wait asynchronously for the given delay seconds.
    • Print a message in the format: "<name> completed after <delay> seconds" when finished.
  • Ensure all three web requests in main() run concurrently, not sequentially.
  • Do not change the function signatures or the main() logic.
  • The output should include all three completion messages, each with the correct request name and delay.

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 4. Chapitre 4
single

single

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

some-alt