You can download this code by clicking the button below.
This code is now available for download.
Calculate the absolute difference between two numbers.
Technology Stack : Built-in function
Code Type : Mathematical calculation function
Code Difficulty :
def abs_diff(x, y):
"""
Calculate the absolute difference between two numbers.
"""
return abs(x - y)