Answer:
# the user is prompt to enter first value
user_val1 = int(input("Enter first value: "))
# the user is prompt to enter second value
user_val2 = int(input("Enter second value: "))
# max_magnitude function is defined
# it takes two parameters
def max_magnitude(user_val1, user_val2):
# if statement to compare the values
# it compare the absolute value of each
if(abs(user_val2) > abs(user_val1)):
return user_val2
elif (abs(user_val1) > abs(user_val2)):
return user_val1
# max_magnitude is called with the
# inputted value as parameter
print(max_magnitude(user_val1, user_val2))
Explanation:
The code is written in Python and well commented. A sample image of program output is attached.