Квиз по 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.

Сложный 10 вопроса ~8 минуты Проходной балл: 80% Python 3.12

Выберите режим

Вы играете как гость: войдите, чтобы сохранить XP и серию.

Пример вопроса

Вопрос 1 из 10

What does this print?

async def greet():
    return "hi"

c = greet()
print(type(c).__name__)
c.close()
Показать ответ

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.

Что проверяет этот квиз

  • Coroutine objects and asyncio.run
  • await in sequence vs asyncio.gather
  • How await asyncio.sleep(0) lets other tasks run
  • create_task and exceptions in gather
  • Why time.sleep blocks the event loop

Частые вопросы

Нужен ли аккаунт?

Нет. Играть может любой. Войдите, чтобы сохранять XP, серию, значки и историю.

Какая версия Python?

Python 3.12. Каждый вопрос о выводе программы проверен запуском кода.

Можно пройти ещё раз?

Да. Лучший результат сохраняется, а вопросы и ответы каждый раз перемешиваются.