Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

3rd Edition

978-1119907466

More Books

Students also viewed these Databases questions