fork download
  1. from __future__ import print_function
  2.  
  3. def f(inlist, l=[]):
  4. if l:
  5. l.append("unexpected surprise")
  6. l.extend(inlist)
  7. return l
  8.  
  9. f([1])
  10. print(f([2]))
Success #stdin #stdout 0.01s 7692KB
stdin
Standard input is empty
stdout
[1, 'unexpected surprise', 2]