Skip to content

High Five Problem


You've created a function called is_highfive(x) that determines whether a number is a "high five" ✋ which you've defined as a number greater than 100 and divisible by five.

Write and run the following three tests inside test_highfive.py:

  1. confirm that 105 is a high five
  2. confirm that 100 is not a high five
  3. confirm that 106 is not a high five

Design your test(s) so that every one of these checks runs, regardless of whether one of them fails.

Directory Structure

highfive/
  highfive.py
  test_highfive.py

Files

def is_highfive(x):
    """
    Check if a is a "high five" -
    a number that's greater than 100 and divisible by 5

    :param a: a number
    :return: True / False
    """

    return x > 100 and x % 5 == 0
# 1. confirm that 105 is a high five
# 2. confirm that 100 is not a high five
# 3. confirm that 106 is not a high five

# your code here