Python Functions Lab Exercises

  1. Write a function named sum_to that accepts a single integer, n, and returns the sum of the integers from 1 to n.

  2. Write a function named largest that takes a list of numbers as an argument and returns the largest number in that list.

  3. Write a function named occurances that takes two string arguments as input and counts the number of occurances of the second string inside the first string.

  4. Write a function named product that takes an arbitrary number of numbers, multiplies them all together, and returns the product.