Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

ELO score calculator for more than two players

Project description

Python ELO score calculator for more than two players


from random import randint
from multi_elo import EloPlayer, calc_new_elos

# generating random players
elo_players = [EloPlayer(place=place, elo=randint(1200, 1800))
               for place in range(1, 5)]

print('Original ELO scores:')
for place, player in enumerate(elo_players, start=1):
    print('{}: {}'.format(place, player.elo))

# setting the K factor
k_factor = 16

# calculating new ELO scores
new_elos = calc_new_elos(elo_players, k_factor)

print('\nNew ELO scores:')
for place, new_elo in enumerate(new_elos, start=1):
    print('{}: {}'.format(place, new_elo))

Project details

Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for multi-elo, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size multi_elo-1.0.0-py3-none-any.whl (3.6 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size multi_elo-1.0.0.tar.gz (2.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page