Python String Compare : Simple == of strings not working.

Using a typeform webhook, provides a json list of questions and answers to a user form. Question and answers are keyed on ID.

I know beforehand what questions and answer ID's are, I now want to loop over the answers. 





For each Question ID, I loop through the answers to get the matching ID, and then I can pluck out the answer. Unfortunately, the equality operator is not working although the stings look the same?

Not pretty, but here is the code (only a small form):

    for answer in user_answers:
        print("answer: " + answer['field']['id'])
        print("name id: " + form_fields["name"])
        print("bio id: " + form_fields["bio"])
        print("interests id: " + form_fields["interests"])  
        
        if answer == form_fields["name"]:
            print("A")
        elif answer == form_fields["bio"]:
            print("B")
        elif answer == form_fields["interests"]:
            print("C")
        else:
            print("D")


    Output:
    answer: aoQDJzkrAVGA
    name id: aoQDJzkrAVGA
    bio id: aOsexSfYNQ8B
    interests id: l6QZGmgHPXEQ
    D
    answer: aOsexSfYNQ8B
    name id: aoQDJzkrAVGA
    bio id: aOsexSfYNQ8B
    interests id: l6QZGmgHPXEQ
    D
    answer: l6QZGmgHPXEQ
    name id: aoQDJzkrAVGA
    bio id: aOsexSfYNQ8B
    interests id: l6QZGmgHPXEQ
    D




We can see that the first pass answer and name ID match - should pring out A, but instead jumps out at the default clause and prints D.

Priority is to understand why this is not working, but also happy if a more efficient method is available to cope with longer forms?