Cody Bable

Generation

generate functionThu, 29 Jun 2023

compare numbers in a list

def compare_list(list): if len(list) == 1: return list[0] if len(list) == 2: return list[0] + list[1] if len(list) >= 3: return list[0] - list[1] * list[2]

Questions about programming?Chat with your personal AI assistant