Cody Bable

Generation

generate functionThu, 29 Jun 2023

compare numbers and return the numbers that are smaller in a list

def compare_numbers(a, b): return [x for x in [a, b] if x < max(a, b)] compare_numbers(2, 1)

Questions about programming?Chat with your personal AI assistant