what happend here? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

what happend here?

can someone say me why my code write for me this: <function rabenu at 0x00875660> it's my code: https://code.sololearn.com/cF1cvbFmE36O/#py

14th May 2017, 1:58 PM
Hysji
3 Answers
+ 3
@Sapphire tx U very much:)
15th May 2017, 6:36 PM
Hysji
+ 1
change: list = [rabenu] to: _list = list (rabenu()) Also be sure to change the for loop call to _list. What happened is you stored a generator object itself inside the list. This has to do with the yield return in your function. By using the built in 'list' function in python, the function will take the returned results and create a list of each value in the generator. *edit* sorry for explanation later. Not always easy to reply on phone.
14th May 2017, 2:10 PM
Sapphire
0
Additionally, you can also do the same thing inside the list by adding a loop: list = [txt for txt in rabenu ()]
14th May 2017, 2:42 PM
Sapphire