Skip to content

Commit 18d3eb4

Browse files
committed
formatting to election results
1 parent 320afe5 commit 18d3eb4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

PyElection/election_data.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ def average(numbers):
88
total += number
99
return total / length
1010

11+
12+
# ELECTION RESULTS ANALYSIS (results printed to terminal)
1113
input_path = os.path.join('.',"election_data.csv")
12-
output_path = ('.', "election_results.txt")
1314

1415
with open(input_path, newline="") as csvfile:
1516
csvreader = csv.reader(csvfile, delimiter=",")
@@ -71,4 +72,7 @@ def average(numbers):
7172
elif Li > Correy and Li > Khan and Li > OTooley:
7273
print("Winner: Li")
7374
elif OTooley > Correy and OTooley > Li and OTooley > Khan:
74-
print("Winner: O'Tooley")
75+
print("Winner: O'Tooley")
76+
77+
# WRITE RESULTS TO TXT
78+
output_path = os.path.join('.', "election_results.txt")

0 commit comments

Comments
 (0)