Seção 4. Capítulo 4
single
Challenge: Async Web Request Simulator
Deslize para mostrar o menu
Tarefa
Deslize para começar a programar
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.
Solução
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 4. Capítulo 4
single
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo