English: Based on the unofficial data taken from here:
https://voteabroad.info/
The data is still uploading, so this map may not be up to date
The method is as follows:
- The amount of people who refused to name their candidate is substracted from 100
- The percentage recorded by a candidate is divided by this new amount
For countries with multiple polling stations, the following code was used:
def smart_to_int(value: float) -> int:
return int(value+0.5)
class Station:
def __init__(self,
voters: int,
putin_percentage: int,
davankov_percentage: int,
refused_percentage: int) -> None:
self.voters = voters
self.putin_percentage = putin_percentage
self.davankov_percentage = davankov_percentage
self.refused_percentage = refused_percentage
self.get_votes()
def get_votes(self):
adjusted_percentage = 100 - self.refused_percentage
self.putin_voters = smart_to_int(self.voters
*self.putin_percentage
/adjusted_percentage)
self.davankov_voters = smart_to_int(self.voters
*self.davankov_percentage
/adjusted_percentage)
def __repr__(self):
return (f"Station({self.voters}, {self.putin_percentage}, "
f"{self.davankov_percentage}, {self.refused_percentage})")
def get_total(*args: Station):
total_votes = 0
putin_votes = 0
davankov_votes = 0
for station in args:
total_votes += station.voters
putin_votes += station.putin_voters
davankov_votes += station.davankov_voters
return putin_votes/total_votes*100, davankov_votes/total_votes*100
city1 = Station(2391, 10, 35, 38)
city2 = Station(2572, 31, 28, 24)
print(get_total(city1, city2))