filbert
filbert copied to clipboard
Creating functions with optional parameters
I seem to get an error if I try to create a function with a default value assigned to a parameter:
class A:
def __init__(self):
self.b = 'hi'
def main(self):
def r(a,b=7):
return a*7
self.r = r
a=A()
a.main()
print(a.r)
print(a.r(8))
This code run just fine (in the filbert tester) until I added the parameter b=7.
#8 is a catchall for advanced function arguments. We can use this issue to track default arguments.
OK, so now I should actually read the issues that are already listed before I post my next one...