Write a program to return the absolute value in Python


Topic: Write a program to return the absolute value in Python

Solution

def get_absolute_value(n):
	if n >= 0:
		return n
	else:
		return -n
print(get_absolute_value(101))



List all Python Programs