Sezione 4. Capitolo 4
single
Challenge: Async Web Request Simulator
Scorri per mostrare il menu
Compito
Scorri per iniziare a programmare
Your task is to implement an asynchronous function to simulate web requests using the asyncio library.
- Complete the
simulate_web_requestcoroutine to:- Wait asynchronously for the given
delayseconds. - Print a message in the format:
"<name> completed after <delay> seconds"when finished.
- Wait asynchronously for the given
- 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.
Soluzione
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 4. Capitolo 4
single
Chieda ad AI
Chieda ad AI
Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione