224k views
4 votes
% Do not modify CalculateSum function maxSum = CalculateSum(userNum1, userNum2, userNum3) maxSum = MaxValue(userNum1, userNum2) + userNum3; end % Define a function MaxValue that returns the largest input value % Function inputs: numA, numB % Function output: maxNum % function maxNum ...

User Mastrianni
by
4.1k points

1 Answer

3 votes

Answer:

The function in Python is as follows:

def MaxValue(userNum1, userNum2):

if userNum2>userNum1:

return userNum2

else:

return userNum1

Step-by-step explanation:

This defines the function

def MaxValue(userNum1, userNum2):

This returns userNum2 if userNum2 is greater than userNum1

if userNum2>userNum1:

return userNum2

If otherwise, this returns userNum1

else:

return userNum1

User Sidharth Panwar
by
4.8k points