Answer:
def max_magnitude(num1, num2):
if abs(num1) >= abs(num2):
return num1
else:
return num2
n1 = int(input("Enter the first number: "))
n2 = int(input("Enter the second number: "))
print(max_magnitude(n1, n2))
Step-by-step explanation:
Create a function called max_magnitude that takes two parameters, num1, and num2
Check the numbers magnitude, use abs function to get their absoulute values.
If magnitude of the first one is greater than or equal to the second one, return first one. Otherwise, return second one.
Get the numbers from the user
Call the function with given numbers to see the result