Posts by echoesAML • 15 points
2 posts
-
1
votes2
answers83
viewsQ: Function that creates list inside list
def add_divisors(list_num): final_list = [] divisors = [] for number in list_num: for x in range(1, number+1): if number % x == 0: divisors.append(x) final_list.extend(divisors.copy())…
-
0
votes1
answer544
viewsQ: Typeerror: 'int' Object is not iterable
def add_divisors(list_num): final_list = [] for number in list_num: final_list.append([number]) for sublist in final_list: for number in sublist: for x in range(1, number + 1): if number % x == 0:…