In python decorator is used to modify a function or a class.
For example: def karma(x):
return x + 1 atharva = karma atharva(10)
or def karma(x):
return x + 1 karma =10 output: 11
This means that we have two names, i.e. “karma” and “atharva” for the same function.
The next important fact is that we can delete either “karma” or “atharva” without deleting the function itself. del karma atharva(10) output: 11