Q:

How to add to a tuple

I have a tuple that passes 3 items to an HTML page, and I want it to pass a fourth. I've read online that to do that, I'd have to turn my tuple into a list, but I tried that, and still didn't get anything (no errors, the objects just didn't show up at the end). So I stashed it for clarity. 
I'm trying to add "maybe_existing_user.fb_pic" to the "details" tuple.
PYTHON
@app.route('/results/<int:id>')
def results(id):
    rate = 0  # either 0 or num/total
    article_list_of_one = Article.query.filter_by(id=id)
    a_obj = article_list_of_one[0]

    avs_obj = retrieve_article_vote_summary(a_obj.id) # vote_summary is a list of [tuples('True', numOfTrue), etc]
    total_votes = avs_obj.getTotalVotes()
    vote_choices = []
    vote_choice_list = VoteChoice.getVoteChoiceList()
    for item in vote_choice_list: # looping over VoteChoice objects
        num = avs_obj.getVoteCount(item.choice)
        if total_votes > 0:        # protecting against no votes
            rate = num/total_votes 
        vote_choices.append([item.choice, item.color, num, rate*100, total_votes])

    details = avs_obj.getVoteDetails() # 10/02 - retrieve array of tuples [(user, VoteChoice, Comments)]
    print("Inside results(" + str(id) + "):")
    details_count = 0
    for detail in details:

        maybe_existing_user = User.query.filter_by(name=detail[0]).first()
        detail += (maybe_existing_user.fb_pic,)

        print(detail)
        #print("    " + str(details_count) + ": " + details[0] + " " + details[1] + " " + details[2])
        details_count += 1

    return render_template('results.html', title=a_obj.title, id=id,
                           image_url=a_obj.image_url, url=a_obj.url,
                           vote_choices=vote_choices, home_data=Article.query.all(),
                           vote_details=details)

HTML
<!DOCTYPE html>
<html>
<body>
{% for detail in vote_details %}
<strong>User:</strong> {{ detail[0] }} &nbsp; <strong>Vote:</strong> {{ detail[1] }} &nbsp; <strong>Comments:</strong> {{ detail[2] }}<br>
{{ detail[3] }}
{% endfor %}
</body>
</html>

A:

You need to create a new 'details' list of tuples. In Python, you often can not change lists "in place". If you just create a new 'detail' inside the for-loop, it will not get passed on to the 'details' list.
So, you need to replace the complete loop for detail in details: by the following line:
updated_details = [(user, VoteChoice, Comments, User.query.filter_by(name=user).first().fb_pic)
                   for (user, VoteChoice, Comments) in details]

At the end, you use these updated details to the returned render_template:
return render_template(..., vote_details=updated_details)

