Update homework_5 election.py

make code shorter in loop