You are given data containing information for the first 100 Pokémon as well as special effectiveness relationships. Use this data to define a function that takes two Pokémon numbers and calculates which Pokémon wins based on their types.
grass, poison), (fire, flying).grass. For each of Venusaur's opponent's types, use the data to obtain grasss effectiveness. The grass is 0.5x (not very) effective against both fire and flying. Multiply these together: 0.5 * 0.5 = 0.25. So 'grass' is 0.25 effective against Charizard. You'll repeat this with Venusaur's second type, poison, and Venusar will receive two scores for his two types: (0.25, 1.0). Average these together to get Venusaur's final score: 0.625.
When Pokémon only have one type they will only have one score and no averaging is necessary.-1 for a tie.pk_special_winner(33, 28) ➞ 28
pk_special_winner(77, 52) ➞ -1
pk_special_winner(25, 44) ➞ 44
pk_special_winner(57, 51) ➞ -1
pk_special_winner(98, 34) ➞ 98
fire against a bug and grass type Pokémon, the effectiveness scores are multiplied. So fire would be four times as effective against such an opponent. See this for more information.
Thanks to the providers of the data:
Which Pokémon beats the most of its opponents in this dataset? See my answer in the comments.