File tree Expand file tree Collapse file tree 3 files changed +32
-76
lines changed Expand file tree Collapse file tree 3 files changed +32
-76
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 33import csv
44
55
6- greatest_increase = ["" , 0 ]
7- greatest_decrease = ["" , 9999999999999999999 ]
6+ greatest_increase = ['' , 0 ]
7+ greatest_decrease = ['' , 9999999999999999999 ]
88change_list = []
99total_change = 0
1010months = []
5454
5555print (f"Average_change : { int (avg_change )} " )
5656
57+ print (f"Greatest Increase in profit:{ greatest_increase ('[' str (row ) ']' ) + change_value } " )
58+
59+ print (f"Greatest Decrease in profit:{ greatest_decrease ('[' str (row ) ']' ) + change_value } " )
60+
61+
62+
63+
5764
5865
5966
Original file line number Diff line number Diff line change 22import csv
33
44vote_count = 0
5- candidate_list = []
6- Candidate = str (row [0 ])
5+ candidate_names = []
6+ candidate_votes = [0 ,0 ,0 ,0 ]
7+
78
89# Path to collect data from the Resources folder
910budget_csv = os .path .join ('.' ,'Resources' ,'election_data.csv' )
1011with open (budget_csv , 'r' ) as csvfile :
12+
1113 csvreader = csv .reader (csvfile , delimiter = ',' )
1214 header = next (csvreader )
13- for row in csvreader :
14- vote_count = vote_count + 1
15- candidate_list .append (str (Candidate )
1615
17- for Candidate in candidate_list
18- print (Candidate )
16+ for row in csvreader :
1917
20- print (vote_count )
18+ vote_count += 1
19+
20+ if candidate [0 ] = !candidate [0 + 1 ]:
21+ candidate_names .append . [str (candidate )]
22+ print (candidate )
23+
24+
25+
26+ for candidates in candidate_names :
27+ candidate_votes += 1
28+ print (candidate_votes )
29+ next candidate
30+ vote_percentage = candidate_votes / vote_count * 100
31+ print (vote_percentage )
32+
33+ print (vote_count )
2134
2235
2336print ("Election results" )
2841
2942print ("---------------------------" )
3043
44+ print ()
45+
3146
3247
3348
You can’t perform that action at this time.
0 commit comments