Skip to content

Above the Threshold

Andrew Burke edited this page Apr 3, 2024 · 7 revisions
def above_threshold(lst, threshold):
	result = []
	for num in lst:
		if num > threshold:
			result.append(threshold)
	return result
	
	
lst = [1,2,3,4,5,6]
result = over(lst, 3)
print(result) # Output: [4, 5, 6]
Clone this wiki locally