election_results.py includes a loop that overwrites a previously declared variable. Script still works but it's a little too confusing for teaching purposes. Change needs to be made below and should be carried over to all elex dirs, branches and tutorial pages to ensure consistency:
forrace_key, cand_resultsinresults.items():
all_votes=0cands= []
# NOTE: below "results" var should be renamed to "row"forcand_key, resultsincand_results.items():
# Populate a new candidate dict using one set of county resultscand= { 'first_name': results[0]['first_name'],
'last_name': results[0]['last_name'],
'party': results[0]['party'],
'winner': '', }
election_results.py includes a loop that overwrites a previously declared variable. Script still works but it's a little too confusing for teaching purposes. Change needs to be made below and should be carried over to all elex dirs, branches and tutorial pages to ensure consistency: