title: append or extend using Lambda in Python
body: <p>I want to do this:</p>
  
  <pre><code>def my_func(x):
      x.extend('\n')
      return x
  
  var1 = [['a', 'b'], ['c', 'd']]
  
  for item in var1:
      var2 = my_func(item)
      print(var2)
  &gt;&gt;&gt;
  ['a', 'b', '\n']
  ['c', 'd', '\n']
  </code></pre>
  
  <p>using Lambda function. When I try</p>
  
  <pre><code>var1 = [['a', 'b'], ['c', 'd']]
  var_x = list(map(lambda x: x.extend('\n'), var1))
  &gt;&gt;&gt;
  [None, None]
  </code></pre>
  
  <p>How to write it then???</p>