0
Why is this code giving an error?(ignoring indentation)
def func(x): for i in range(x): yield i**2 print(",".join(list(func(3))))
3 Respuestas
0
just switch the yield statement to make it a string output. cant join numbers, but you can join strings
https://code.sololearn.com/cJl7YMIgbrSp/?ref=app
+ 1
newstring = '-'.join(list)
listback = newstring.split('-')
0
can we also convert the list to string after generation?