In my Python script, I have a function in which I’ve declared a string variable and added content to it:
content = ""
for row in data:
content += compile(partial_content) # Adds content to the variable
print(content) # Prints the content correctly
return content
When I call the function, it returns None, even though it’s printing the variable correctly inside of the function.
Any ideas on how to solve this?
Thanks 🙂
New contributor
Mikuel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1