osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

What does <generator object <generator object <genexpr> at 0x0402C7B0> mean?


On Wed, May 22, 2019 at 11:16 AM CrazyVideoGamez
<jasonanyilian at gmail.com> wrote:
>
> I tried doing a list comprehension. I typed:
>
> favorite_fruits = ['watermelon', 'blackberries']
> print(fruit for fruit in favorite_fruits)
>
> And I got:
>
> <generator object <genexpr> at 0x0402C7B0>
>
> What does this mean and what do I have to fix?

It means that you just printed out a generator object. But to "fix"
this, you first have to explain what you wanted.

ChrisA