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