+ 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
3 Respuestas
+ 3
@Sapphire tx U very much:)
+ 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.
0
Additionally, you can also do the same thing inside the list by adding a loop:
list = [txt for txt in rabenu ()]