❓ 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
Python Data Science Jobs & Interviews
Your go-to hub for Python and Data Science—featuring questions, answers, quizzes, and interview tips to sharpen your skills and boost your career in the data-driven world.
Admin: @Hussein_Sheikho
Admin: @Hussein_Sheikho