'add an attribute to multiple functions

I have multiple functions, I want to add the same attribute to them, but do not want to specify it in each of them, how do I achieve this?

def func(a, b):
  c = a%b
  return a + b + c

def func2(a, b):
  c = a%b
  retrun a - b + c

def func3(a, b):
  c = a%b
  retrun a * b + c

is ther an alternative to add c = a%b to each of them.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source