📅  最后修改于: 2023-12-03 15:32:54.291000             🧑  作者: Mango
Mike Tyson Peso Pesado is a Python package that provides the functionality for simulating boxing matches between historical heavyweight boxers.
You can install the package using pip:
pip install mike-tyson-peso-pesado
First, import the MikeTysonPesoPesado
class from the package:
from mike_tyson_peso_pesado import MikeTysonPesoPesado
Then, create an instance of the class and call the simulate_fight
method, passing in the names of the two boxers you want to simulate a fight between:
tyson = MikeTysonPesoPesado()
result = tyson.simulate_fight("Mike Tyson", "Muhammad Ali")
The simulate_fight
method returns the result of the fight in the form of a dictionary with the following keys:
"winner"
: the name of the winner of the fight"method"
: the method by which the winner won (e.g. KO, TKO, UD, MD)"round"
: the round in which the fight endedHere's an example of how to print out the result of the fight:
print("{} defeated {} by {} in round {}".format(
result["winner"], result["loser"], result["method"], result["round"]))
Currently, the following historical heavyweight boxers are supported:
The Mike Tyson Peso Pesado package is also available as a wrapper for the Sporting AI API, which provides access to a much larger set of boxing data and statistics. You can learn more about the Sporting AI API at https://www.sportingai.com/.
To use the wrapper, first install the sportingai
package:
pip install sportingai
Then, import the SportingAIBoxing
class from the sportingai
package and pass it to the constructor of the MikeTysonPesoPesado
class:
from sportingai.boxing import SportingAIBoxing
tyson = MikeTysonPesoPesado(SportingAIBoxing())
Now, when you call the simulate_fight
method, it will use data and statistics from the Sporting AI API to simulate the fight.
Mike Tyson Peso Pesado is a Python package that provides the functionality for simulating boxing matches between historical heavyweight boxers. With its support for a variety of boxers and a wrapper for the Sporting AI API, it's a useful tool for anyone interested in the sport of boxing.