Designing and Using Functions

2. a. max(3, 4), then abs(-5), then min(4, 5).
b. max(2, 8), then min(4, 6, 8), then abs(4).
c. max(5.572, 3.258), then abs(-2), then round(5.572, 2).

4.

def absolute_difference(number1, number2):
    """ (number, number) -> number

    Return the absolute value of the difference between number1
    and number2.

    >>> absolute_difference(3, 7)
    4    
    """ 
    return abs(number1 - number2)

6.

def average_grade(grade1, grade2, grade3):
    """ (number, number, number) -> number

    Return the average of the grade1, grade2, and grade3, where
    each grade ranges from 0 to 100, inclusive.

    >>> average_grade(80, 95, 90)
    88.33333333333333
    """ 
    return (grade1 + grade2 + grade3) / 3

8.

Parameter num
Argument 3
Function name square
Function call square(3)

10.

def weeks_elapsed(day1, day2):
    """ (int, int) -> int
    day1 and day2 are days in the same year. Return the number of full weeks
    that have elapsed between the two days.

    >>> weeks_elapsed(3, 20)
    2
    >>> weeks_elapsed(20, 3)
    2
    >>> weeks_elapsed(8, 5)
    0
    >>> weeks_elapsed(40, 61)
    3
    """ 
    return int(abs(day1 - day2) / 7)