Autumn Offers - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Practice

Instruction

Great! Do you remember lists?

Exercise

Write a function called find_greater_than() that takes two parameters: a list of numbers and an integer threshold. The function should create a new list that contains all numbers in the input list that are greater than the given threshold. The order of numbers in the result list should be the same as in the input list.

For example:

find_greater_than([-3, 2, 8, 15, 31, 5, 4, 8], 5)
>>> [8, 15, 31, 8]

Stuck? Here's a hint!

First, create a new list.

new_list = []

Iterate over the numbers in the original list. You can append numbers to the new list like this:

new_list.append(integer)