Tell us what’s happening:
Tests 3-9 fail with generic error before running any tests message without specific information (Detailed test report did not help). However, console is error free and when tested by pasting the test cases, both the print and return requirement seems to be fulfilled correctly.
Your code so far
def adjacency_list_to_matrix(adjacency_list: dict):
adjacency_matrix = []
for key in items.keys():
adjacency_matrix.append([0 for key in items.keys()])
for key, value in adjacency_list.items():
for member in value:
adjacency_matrix[key][member] = 1
# print(adjacency_matrix[key])
for line in adjacency_matrix:
print(line)
return adjacency_matrix
#items = {
# 0: [1, 2], 1: [2], 2: [0, 3], 3: [2]
#}
#print(adjacency_list_to_matrix(items))
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64; rv:147.0) Gecko/20100101 Firefox/147.0
Challenge Information:
Build an Adjacency List to Matrix Converter - Build an Adjacency List to Matrix Converter