title: Square and Summing a List
body: <p>I'm working on the problem below, but I'm a little stuck on how to set up my main function:</p>
  <p>Write a program that will accept a list of numbers from the user. Write and test two functions to meet the following specifications:</p>
  <blockquote>
  <p>squareEach(nums), nums is a list of numbers, returns a list of the square of each number in the list</p>
  <p>sumList(nums), nums is a list of numbers, returns the sum of the numbers in the list</p>
  <p>Print the original list, the list of squared values and the sum of the list.</p>
  </blockquote>
  <pre><code>#import reduce function
  from functools import reduce
  
  def numbers(n):
      numbers = []
  
      data = input(&quot;Enter a number or press Enter to quit: &quot;)
  
      while True: 
          #request input from user
          data = input(&quot;Enter a number or press Enter to quit: &quot;)
  
          #set up the termination condition    
          if data == &quot;&quot;:
              break
  
  #define square function
  def SquareEach(numbers):
      return map(lambda x: x**2, numbers)
  
  #define sum function
  def SumList(numbers):
      return map(lambda x, y: x + y, numbers)
  
  #main program start
  def main(): 
  
  #main program end
  main()
  </code></pre>