Respuesta :
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.

The function which returns the maximum magnitude value of the two user inputted values written in python 3 is given below ;
val1 = int(input())
- #first value given by the user
val2 = int(input())
- #second value given by user
def max_magnitude(user_val1 , user_val2):
- #max_magnitude function initialized with two arguments which are the user supplied values.
maximum = val1
- #first value is initially set as the maximum value.
if abs(val1)>abs(val2):
- #checks which is greater between the absolute values of the two numbers .
maximum = val1
- # if it's first value is greater, then assign as the maximum
else:
maximum = val2
- # if otherwise, set the 2nd input as maximum
return maximum
- # return the maximum value.
print(max(user_val1, user_val2))
Learn more :https://brainly.com/question/15565936
