Question: Python Consider the following two code segments: oldAverage 197.4 total Score- for index in range 3): score input(Enter Alex's game [o score: .format index 1)

Python  Python Consider the following two code segments: oldAverage 197.4 total Score-

Consider the following two code segments: oldAverage 197.4 total Score- for index in range 3): score input("Enter Alex's game [o score: ".format index 1) totalScore totalScore +score newAverage totalScore/3 difference newAverage oldAverage oldAverage 165.1 totalScore0 for index in rangeC 4 : score inputC"Enter Aarons's game (0) score: ".formatC index+ 1) totalScore totalScorescore newAverage -totalScore 4 difference newAverage oldAverage Imagine you were to combine these into a single function named getAverageDifference Considering what is the same and what is different between the two segments: 1. What could the parameters to getAverageDifference be such to effectively parameterize the differing values in the two code segments? 2. In your own words, what would the role of each parameter be in the 'getAverageDifference function? Please do not write any code for this answer, only give the parameter names and explain what role they would play in the function HTML Editor Paragraph

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!