Learn Python generators in 8 minutes! 🚰
45.4K views on YouTube
#python #coding #programming
# Generator = Function that behaves like an iterator (it can be used in a for loop)
# Pauses a function, returns a value, then resumes
# Uses ‘yield’ instead or ‘return’
# Iterate without loading everything into memory (ex. reading large files)
# return = Pouring bucket
# yield = Drip faucet