jeudi 16 juin 2016

Python- for loop issue [on hold]


class divide(list_out):

def divide_list(list1 ,list2): list_out = [] for number1 in list1: for number2 in list2: list_out.append(number1/number2) return list_out

# Test case print divide_list([1,2,3],[4,5,6])

# Desired output for test case: [0.25, 0.4, 0.5]

Aucun commentaire:

Enregistrer un commentaire