Cooperative Learning Question

Subject: Functions

On a piece of paper, write your NAME, SECTION and DATE.

  1. Write the definition of a function which has two parameters. The function returns the difference of the two parameters. (first one minus second one)
    ANSWER:
        def sub(a, b);
          return a - b
    
  2. Write a call to the function with the values 8.9 and 4.2. Store the result in the variable diff.
    ANSWER: diff = sub(8.9, 4.2)