---
title: "Discussion on \"Generators in Python: Is there a need for them?\" | Hashnode"
description: "Discussion on \"Generators in Python: Is there a need for them?\". A python generator is basically a python function with a yield rather than a return keyword."
url: "https://hashnode.com/posts/generators-in-python-is-there-a-need-for-them/60c8839d590a5c06565661b4"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Generators in Python: Is there a need for them?](https://mergemypr.hashnode.dev/generators-in-python-is-there-a-need-for-them?utm_source=hashnode&utm_medium=feed)

A python generator is basically a python function with a yield rather than a return keyword.

Jun 15, 2021 · 3 min read · mergemypr.hashnode.dev  
Updated Oct 11, 2024  
Read the article

-   [#python](https://hashnode.com/tag/python)
-   [#python3](https://hashnode.com/tag/python3)
-   [#python-beginner](https://hashnode.com/tag/python-beginner)
-   [#python-projects](https://hashnode.com/tag/python-projects)
-   [#generators](https://hashnode.com/tag/generators)

## Written by

[MergeMyPR](https://hashnode.com/@Resa)

@Resa · Lagos, Nigeria

  
[View profile](https://hashnode.com/@Resa)

Developer, Writer, Other

I am a Software Engineer from Lagos, Nigeria.

## Responses 1

Markdown supported · ⌘↵ to post

[Oluwapelumi](https://hashnode.com/@Oluwap)

[Jun 16, 2021](https://hashnode.com/posts/generators-in-python-is-there-a-need-for-them/60c8839d590a5c06565661b4/comment/60c9495c80c5541363dd2a0e)

This is very informative. In all my months of learning python, I haven't seen it like this (I mean the use of yield).

[MergeMyPR](https://hashnode.com/@Resa)

[Jun 16, 2021](https://hashnode.com/posts/generators-in-python-is-there-a-need-for-them/60c8839d590a5c06565661b4/comment/60c9495c80c5541363dd2a0e#reply-60c9eb08212fea1a6a2a6a4b)

I am glad you found it informative.
