Some example of small logical programs in Python?

Here are a list of some examples of small logical programs in Python.

##Write a Python program to get the difference between a given number and 17, if the number is greater than 17 return double the absolute difference.
def get_difference(n):
  if n < 17:
    return 17 - n
  else:
    return (n - 17)*2

diff1 = get_difference(15)
diff2 = get_difference(20)

print(diff1)
print(diff2)
###########################

##Write a Python program to calculate the sum of three given numbers, if the values are equal then return thrice of their sum
def get_sum(a,b,c):
  if (a == b == c):
    return (a+b+c)*3
  else:
    return (a+b+c)


n1 = get_sum(1, 2, 3)
n2 = get_sum(1, 1, 1)
print(n1)
print(n2)
#############################