I am trying to return all product reviews by user name.
I have written a generator function but on coming back to it, it does not work and returns a syntax error:
def find_reviews(username):
for u in reviewers_dicts:
if u['username'] == username:
review = u['reviews']
yield review
print(review)
next
find_reviews('krpz1113')
I am getting the following error:
<generator object find_reviews at 0x0000016C852CECF0>