I am writing a new python class with a generic function. At one point I have a requirement as follows
def function(a=1):
....
....
print a # here I want a to be 1 if None or nothing is passed
Eg:
- a(None) should print 1
- a() should print 1
- a(2) should print 2
Is there a way to do this?