---
title: 'asyncio in Python - Async/Await'
source: 'https://youtube.com/watch?v=3E-Ym2mbSCc'
video_id: '3E-Ym2mbSCc'
date: 2026-06-16
duration_sec: 0
---

# asyncio in Python - Async/Await

> Source: [asyncio in Python - Async/Await](https://youtube.com/watch?v=3E-Ym2mbSCc)

## Summary

This video explains how to use async and await in Python for asynchronous programming. It demonstrates how marking functions with the `async` keyword turns them into coroutines that can be paused and resumed, allowing concurrent execution of tasks.

### Key Points

- **Async/Await in Python** [0:00] — The video introduces async/await in Python, noting that it is not exclusive to JavaScript.
- **Coroutines and async keyword** [0:12] — Marking a function with `async` makes it a coroutine, which can be paused and resumed to let other tasks run.
- **Need for asyncio library** [0:31] — To use `await`, Python requires the `asyncio` library.
- **Benefits of async/await** [0:34] — Async/await enables non-blocking code that performs tasks concurrently, leading to faster and more responsive programs.
- **Synchronous vs asynchronous comparison** [0:46] — Two scenarios: synchronous function (left) and asynchronous function (right) doing the same task over 10 laps. The async function wins by a large margin.
- **Example with load_data and task** [1:13] — Two functions: `load_data` (simulates heavy data loading) and `task` (normal task). The main function executes them concurrently. Output shows that while data loads, another task runs, and the program exits after data is fully loaded.
- **Recap** [1:41] — Async and await are essential for asynchronous programming in Python, allowing non-blocking concurrent code.

### Conclusion

Async/await in Python, via the asyncio library, allows writing non-blocking concurrent code that improves program speed and responsiveness.

## Transcript

async await oh no is this going
somewhere off of python well it's not we
can use async AWA in Python too let's
see how consider this function the task
is an asynchronous function because it's
marked with the async keyword in Python
when we Mark a function with the async
it becomes a
coroutine coroutines can be paused and
resumed allowing other tasks to run in
the meantime to use Ayn we in Python we
need to use the async IO
Library so what's the need to write
asynchronous functions in Python by
using async in a wait we can write
non-blocking code that performs tasks
concurrently resulting in faster and
more responsive programs here we have
two scenarios on the left we have a
synchronous function and on the right we
have an asynchronous function both
functions do the same thing and we are
checking who's going to take less time
to complete over 10 laps here's the
output and it clearly shows that the
asynchronous function won by a big
margin that was fast asynchronous
functions don't wait for one task to
complete they go all in executing tasks
concurrently let's see another one here
we have two functions load underscore
data and task the load underscore data
function simulates loading heavy data
while the task function simulates a
normal task the main function executes
both functions in sequence concurrently
upon running the code this output is
generated this shows that while the
program begins loading the data another
task gets executed in the meantime and
the program exits once the data is
completely loaded to recap async and
await are essential tools for
asynchronous programming in Python by
marking functions as async and using the
await keyword we can write non-blocking
code that performs tasks concurrently
resulting in faster and more responsive
programs thanks for watching don't
forget to like share and subscribe for
more python tutorials
