Answer: provided in the explanation section
Explanation:
This is actually quite easy to go,i ask that you follow it carefully.
CODE is meant for python3+
CODE
def stats(pokemon):
total=0
#loops over the stats list
for stat in pokemon["stats"]:
# adds the stat to the total
total+=stat["base_stat"]
return total
def fight(first_pokemon,second_pokemon):
#prints the first statemetn
print(first_pokemon["name"],"has",stats(first_pokemon),"combined stats.",second_pokemon["name"],"has",stats(second_pokemon),"combined stats.")
#checks if the first_pokemon wins
if(stats(first_pokemon)>stats(second_pokemon)):
print(first_pokemon["name"],"wins!")
#checks if the second_pokemon wins
elif(stats(first_pokemon)<stats(second_pokemon)):
print(second_pokemon["name"],"wins!")
# it is a draw
else:
print("It is a draw")
cheers i hoped this helped !!!