I'm trying to get my results function to call my retrieve_pub_vote_summary function, which creates a tuple. I then want my results function to print the tuple.
@application.route('/results/')
def results:
publication = "nytimes"
retrieve_pub_vote_summary(publication)
print(pub_tuple)
##############################################
def retrieve_pub_vote_summary(publication):
onevotes = 1
twovotes = 2
pub_tuple = (onevotes, twovotes)
print(pub_tuple)
return pub_tuple
pub_tuple prints fine in retrieve_pub_vote_summary. But it doesn't seem to go to results. I get "NameError: name 'pub_tuple' is not defined."