Skip to content

singly_linked_list.py: psf/black #2008

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DIRECTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@
* [Add](https://github.com/TheAlgorithms/Python/blob/master/maths/add.py)
* [Aliquot Sum](https://github.com/TheAlgorithms/Python/blob/master/maths/aliquot_sum.py)
* [Allocation Number](https://github.com/TheAlgorithms/Python/blob/master/maths/allocation_number.py)
* [Area](https://github.com/TheAlgorithms/Python/blob/master/maths/area.py)
* [Area Under Curve](https://github.com/TheAlgorithms/Python/blob/master/maths/area_under_curve.py)
* [Armstrong Numbers](https://github.com/TheAlgorithms/Python/blob/master/maths/armstrong_numbers.py)
* [Average Mean](https://github.com/TheAlgorithms/Python/blob/master/maths/average_mean.py)
Expand Down
10 changes: 5 additions & 5 deletions data_structures/linked_list/singly_linked_list.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
class Node: # create a Node
class Node:
def __init__(self, data):
self.data = data # given data
self.next = None # given next to None
self.data = data
self.next = None

def __repr__(self): # string representation of a Node
def __repr__(self):
return f"Node({self.data})"


Expand Down Expand Up @@ -106,7 +106,7 @@ def __setitem__(self, index, data):
raise IndexError("Index out of range.")
current = current.next
current.data = data

def __len__(self):
"""
Return length of linked list i.e. number of nodes
Expand Down