re: Why is "string" not being changed when I use += in python? VIEW POST

re: I found the answer in my latest post, please look at that for the new question I have...

After looking at that post, it seems that implementing the changes I mentioned here should alleviate the problem. In particular, the change mentioned in the third code block is what'll fix the string issue. I've put it below for reference:

if char == "\"" or char == "'":
    tok = tok[:-1]  # get rid of the " or ' added to tok
    state = True  # set the state to be in a string
code of conduct - report abuse