Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Exercise: benchmark list-comprehension, map, for

  • Create several functions that accept a list of numbers from 1 to 1000 and calculate their square:

  • A function with a for-loop.

  • A function that uses map.

  • A function that uses list-comprehension.

  • Feel free to have any other calucaltion and measure that.

  • Send me the code and the results!