closure_defargs.py 154 B

1234567891011
  1. # test closure with default args
  2. def f():
  3. a = 1
  4. def bar(b = 10, c = 20):
  5. print(a + b + c)
  6. bar()
  7. bar(2)
  8. bar(2, 3)
  9. print(f())