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

TOP OF THREAD FULL DISCUSSION
re: I'd recommend trying to print the value of the string variable right after the variable is supposed to be updated. When I did this, it appeared tha...
 

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