Select Page

NoteELO rating system: Assert statements are not required for this question. You may use loops for this question.A lot of games nowadays have a competitive system in which players can play to increase their skill rating and compete to be one of the highest ranked players in the game. In Dota 2, a system called the is used to calculate the skill level of a player and is used to match players in a game. Suppose you are a developer and you are investigating some complaints about being matched up with players with ratings that are too low/too high compared to their team or enemy. You investigate the issue and figure out that player ratings are fluctuating in a weird pattern only in certain games! You solve the bias in the ratings and are faced with the following task:Given an iterable object representing game ratings of a player, a function, and a value k, return a list that changes the game ratings based on the function, skipping games in between with increasing intervals (skip 0 games, then 1 game, then 2, and so on) for the first k games. The size of the list should be equal to or less than k.Do not convert the input back into its original type.An example is shown here:>>> fix_mmr(iter([175, 1338, 667, 1311, 736, 756, 1319, 787, 701, 776, 1278, 685]), lambda x : x//2 if x >= 700 else x*2, 8)175 -> func(175) -> 350 (skip 0)1338 -> func(1338) -> 669 (skip 1, so also insert 667 to final list)1311 -> func(1311) -> 655 (skip 2, so also insert 736 and 756 to final list)1319 -> func(1319) -> 659 (skip 3, but because k = 8, only insert 787)Final output:[350, 669, 667, 655, 736, 756, 659, 787]Hints:Keeping track of the length of your final output will be important in determining when to break the loop, if needed.Because the number of skips increase after each rating change, it might be useful to keep track of the number of games to skip for each iterationThenext() function described in problem 4 might be helpful for skipping through certain games. You can combine this function with looping to skip multiple elements in a row.deffix_mmr(mmr_iterable, func, k): “””>>> fix_mmr(iter([175, 1338, 667, 1311, 736, 756, 1319, 787, 701, 776, 1278, 685]), lambda x : x//2 if x >= 700 else x*2, 8)[350, 669, 667, 655, 736, 756, 659, 787]>>> fix_mmr(iter([175, 1338, 667, 1311, 736, 756, 1319, 787, 701, 776, 1278, 685]), lambda x : x//2 if x >= 700 else x*2, float(‘inf’))[350, 669, 667, 655, 736, 756, 659, 787, 701, 776, 639, 685]>>> fix_mmr(iter([10, 20, 30, 40, 50, 60]), lambda x: abs(x-35), 5)[25, 15, 30, 5, 50]”””Computer ScienceEngineering & TechnologyPython Programming ICS 31

Order your essay today and save 20% with the discount code ESSAYHELP