Ruff fixes (#8913)

* updating DIRECTORY.md

* Fix ruff error in eulerian_path_and_circuit_for_undirected_graph.py

* Fix ruff error in newtons_second_law_of_motion.py

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
Tianyi Zheng
2023-07-31 13:53:26 -07:00
committed by GitHub
parent 90a8e6e0d2
commit 5cf34d901e
3 changed files with 3 additions and 3 deletions

View File

@ -20,7 +20,7 @@ def check_circuit_or_path(graph, max_node):
odd_degree_nodes = 0
odd_node = -1
for i in range(max_node):
if i not in graph.keys():
if i not in graph:
continue
if len(graph[i]) % 2 == 1:
odd_degree_nodes += 1