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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -236,8 +236,8 @@
* [Double Ended Queue](data_structures/queue/double_ended_queue.py) * [Double Ended Queue](data_structures/queue/double_ended_queue.py)
* [Linked Queue](data_structures/queue/linked_queue.py) * [Linked Queue](data_structures/queue/linked_queue.py)
* [Priority Queue Using List](data_structures/queue/priority_queue_using_list.py) * [Priority Queue Using List](data_structures/queue/priority_queue_using_list.py)
* [Queue By List](data_structures/queue/queue_by_list.py)
* [Queue By Two Stacks](data_structures/queue/queue_by_two_stacks.py) * [Queue By Two Stacks](data_structures/queue/queue_by_two_stacks.py)
* [Queue On List](data_structures/queue/queue_on_list.py)
* [Queue On Pseudo Stack](data_structures/queue/queue_on_pseudo_stack.py) * [Queue On Pseudo Stack](data_structures/queue/queue_on_pseudo_stack.py)
* Stacks * Stacks
* [Balanced Parentheses](data_structures/stacks/balanced_parentheses.py) * [Balanced Parentheses](data_structures/stacks/balanced_parentheses.py)

View File

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

View File

@ -60,7 +60,7 @@ def newtons_second_law_of_motion(mass: float, acceleration: float) -> float:
>>> newtons_second_law_of_motion(2.0, 1) >>> newtons_second_law_of_motion(2.0, 1)
2.0 2.0
""" """
force = float() force = 0.0
try: try:
force = mass * acceleration force = mass * acceleration
except Exception: except Exception: