You can't add a string and a numerical together. There are a couple options.
Here's one:
#Dim variables
total_votes = 0
candidate = {}
for row in csvreader:
if row[2] in candidate.keys():
candidate[row[2]] += 1
else:
candidate[row[2]] = 1
total_votes += 1
for key, value in candidate.items():
percentage = int(value)/int(total_votes)
# Using commas
print(key, " v ", percentage)
print(f"Tolal votes {total_votes}")
I notice you've also used a f-string below. Two thoughts on this: f-strings only work on later versions of python3. If you're having an error here, it may be because of your version. Second, you can also use an f-string to print your key and value:
print(f"{key} v {value}")
Assuming your dictionary is valid, this will work.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…