Closed jachkoune closed 6 months ago
Hi 👋 It looks like generate_answer
returns a Python Generator
instead of a standard list
(which you're probably expecting). I'm guessing the reason a Generator
is used in this case is for the large amounts of data so they're not read into your computer memory immediately (which would slow everything down)
You can look into the generator by running something like:
import people_also_ask
import time
answers = people_also_ask.generate_answer("coffee")
for answer in answers:
print(" ")
print(answer)
print(" ")
time.sleep(1)
For learning a bit more about Generators and why they're used take a look at: https://realpython.com/introduction-to-python-generators/
Hi and thanks for all the good job,
i got the error :generator object generate_answer at 0x1012143c0 when i try to display the result of below code:
`import people_also_ask
print(people_also_ask.generate_answer("coffee")) `