title: Write pure and functional code in Python using the concept higher-order functions like in JavaScript
body: <p>How would one use higher-order functions (functions returning other functions) in Python?</p>
  
  <p>This is my JavaScript example, whose programming concept I would like to use in Python as well.
  Let's say, for example, that I would like to wrap a string in an HTML element. In JavaScript, it would look like this:</p>
  
  <pre><code>var wrapInElement = function(ele) {
      return function(inp) {
          return "&lt;" + ele + "&gt;" + inp + "&lt;/" + ele + "&gt;";
      };
  };
  </code></pre>
  
  <p>And then I would use it like this:</p>
  
  <pre><code>var names = ["Mike", "Tony", "John"];
  names.map(wrapInElement("p"));
  </code></pre>
  
  <p>How could this look like in Python? Is there a way to write functions that return customized functions like in the example above? One could also write a class in Python that accomplishes this task but wouldn't that be too much for such a basic task?</p>