I'm getting this (annoying) error about a variable. Here is my code, I don't get what's causing it and don't know how to fix it:
stringData = ''
newLine = True
def displayData():
print(stringData)
def addData(str):
if newLine and stringData != '':
stringData += f'\n{str}'
else:
stringData += str
It does not give much context for the error and I can't find out how to fix it.