**CS 111 f19 - Lecture 13 Worksheet** --- # Write a program vs write a function Let's say our task is to compute the sum of a list. How would you describe the difference between writing a program to do this and writing a function do to this? # Absolute value of a list Write two versions of a function that takes a list of numbers and returns a list with the absolute value of each of those numbers. The first version should modify the original list. The second version should create a new list. +++++ # Diamonds Write code that given a variable `n`, prints out a diamond `2*n + 1` stars tall. For example, `n = 3` would print out this:
   *    
  ***   
 *****
*******
 *****
  ***
   *
and `n = 5` would print
     *    
    ***   
   *****
  *******
 *********
***********
 *********
  *******
   *****
    ***
     *