Skip to content

Commit c147003

Browse files
committed
Three Hundred - Thirty-Three Commit: Implement edges_print() function
1 parent ff601f6 commit c147003

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Section_12(Graphs)/(1)_graph.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,10 @@ def edge_count(self):
7474
def vertices_print(self):
7575
for i in range(self._vertices):
7676
print(i, end=' ')
77-
print()
77+
print()
78+
79+
def edges_print(self):
80+
for i in range(self._vertices):
81+
for j in range(self._vertices):
82+
if self._adjacent_matrix[i][j] != 0:
83+
print(i, '--', j)

0 commit comments

Comments
 (0)