0
Function .join()
def digit_sum(x): emp = ["2"] y = str(x) emp.append(y) "x".join(emp) print (emp) digit_sum(1234) output: ['2', '1234'] Why is the function .join() not working? Is it because i place the .join() in the function? Thanks in advance!
2 odpowiedzi
+ 9
.join returns a string but you have to assign to something. For the time being replace the last print command with print("x".join(emp))
+ 1
Oh now i understand! Thanks for you help!