A coroutine is a computer program component that generalizes a subroutine by allowing execution to be suspended and resumed. Instead of running from start to finish in one go, a coroutine saves its state, pauses at specific points, and lets other tasks run before picking up where it left off