❓ Interview question
What is a generator in Python?
Answer:A generator is a special type of function that returns an iterator using the `yield` keyword instead of `return`. It allows you to generate a sequence of values lazily, meaning values are produced on-demand rather than all at once. This saves memory and improves performance when dealing with large datasets.
tags: #python #interview #generator #iterator #programming
By: t.iss.one/DataScienceQ 🚀
What is a generator in Python?
Answer:
tags: #python #interview #generator #iterator #programming
By: t.iss.one/DataScienceQ 🚀
Telegram
PyData Careers
Python Data Science jobs, interview tips, and career insights for aspiring professionals.
Admin: @HusseinSheikho || @Hussein_Sheikho
Admin: @HusseinSheikho || @Hussein_Sheikho