Let's say I have a function that takes a list and returns a concatenated string.
stringList = ["hello", "world"]
for string in stringList():
#concatenate all strings in list
return newString
Expected output should be "helloworld"
My original idea was:
for string in stringList():
string = string + ""
return string
However, this would only return the last element of a list. I'm not sure how to fix this. Also, I cannot use the print function and simply do:
print(string, end="")