- Executores
-
Aprender
Aprender Python Exemplos executáveis, NumPy, pandas e mais Aprender IA / Machine LearningRedes neurais, ML e LLMs do zero Aprender C e C++ Ponteiros, memória, STL e C++ moderno Aprender C#Fundamentos, POO, LINQ, async e exercícios .NET Aprender MatplotlibGráficos de linha, barras, dispersão e pizza com visualizadores Aprender RustOwnership, traits, tratamento de erros e threads Aprender GoSlices, interfaces, goroutines e channels Algoritmos em Python Busca, ordenação, recursão e visualizações O(n) Algoritmos em C e C++ Compare implementações em C e C++ Programação para crianças Aprenda a programar brincando!
- QuizzesNovo
- DesafiosNovo
- Para professoresNovo
- Atualizações
- Me pague um café
Quiz de Python: asyncio Basics
This Python quiz covers the basics of asyncio and async/await. You will trace small coroutines step by step to see when code runs concurrently, what gather returns, and which mistakes block the event loop or never run at all.
Pergunta de exemplo
Pergunta 1 de 10What does this print?
async def greet():
return "hi"
c = greet()
print(type(c).__name__)
c.close()
Mostrar a resposta
B. coroutine Calling an async def function does not run its body. It returns a coroutine object, which only runs when it is awaited or passed to something like asyncio.run.
O que este quiz cobre
- Coroutine objects and
asyncio.run awaitin sequence vsasyncio.gather- How
await asyncio.sleep(0)lets other tasks run create_taskand exceptions ingather- Why
time.sleepblocks the event loop
Perguntas frequentes
Preciso de uma conta?
Não. Qualquer pessoa pode jogar. Entre para guardar seu XP, sequência, badges e histórico.
Qual versão do Python?
Python 3.12. Toda pergunta sobre a saída foi conferida rodando o código.
Posso refazer?
Pode. Sua melhor nota fica salva, e as perguntas e respostas são embaralhadas a cada vez.