data_structures/linked_list: Adding __str__() function #3960#3961
data_structures/linked_list: Adding __str__() function #3960#3961dhruvmanila merged 10 commits intoTheAlgorithms:masterfrom
Conversation
|
I'm not really sure what went wrong during the build check. |
|
Your doctest failed, please verify it |
|
Thanks for bringing that up. I've never used doctests in python before so I'll do some more research. Based upon looking at other Pull Requests, I thought it was just a comment that shows others how to use it but I didn't know it also gets executed. |
Co-authored-by: xcodz-dot <71920621+xcodz-dot@users.noreply.github.com>
Thank you for catching that spelling mistake. I really like the format of the output, I committed the changes you added. |
dhruvmanila
left a comment
There was a problem hiding this comment.
If possible, can you add type hints for other functions/parameters as well? Thanks if you do, otherwise after this small change the PR is good to go.
|
Yeah definitely, I'll include type hinting and also add comments to describe some of the functionality. It's midnight for me, so I will have it done by tomorrow morning. |
|
Great, Also your doctests were failing because of the whitespace in that line which was required but trimmed by pre commit |
|
try this solution every time pre-commit fails:
|
Thanks for letting me know! I have done what you suggested. I'll commit again. |
|
If you've downloaded |
|
@xcodz-dot If you give instructions to users about installing |
|
Seriously thank you guys for helping and guiding me. I'm a little new to this but I'll continue to learn and make more meaningful contributions along the way! |
I will sure do that, i am just going to add that to contributing.md and will make a PR quickly |
* Adding __str__() function * Removing white space * Update data_structures/linked_list/__init__.py Co-authored-by: xcodz-dot <71920621+xcodz-dot@users.noreply.github.com> * Adding type hints * Update __init__.py * Update __init__.py * Adding the changes requested * Updating to fix pre-commit * Updating __init__.py * Updating __init__.py Co-authored-by: xcodz-dot <71920621+xcodz-dot@users.noreply.github.com>
* Adding __str__() function * Removing white space * Update data_structures/linked_list/__init__.py Co-authored-by: xcodz-dot <71920621+xcodz-dot@users.noreply.github.com> * Adding type hints * Update __init__.py * Update __init__.py * Adding the changes requested * Updating to fix pre-commit * Updating __init__.py * Updating __init__.py Co-authored-by: xcodz-dot <71920621+xcodz-dot@users.noreply.github.com>
* Adding __str__() function * Removing white space * Update data_structures/linked_list/__init__.py Co-authored-by: xcodz-dot <71920621+xcodz-dot@users.noreply.github.com> * Adding type hints * Update __init__.py * Update __init__.py * Adding the changes requested * Updating to fix pre-commit * Updating __init__.py * Updating __init__.py Co-authored-by: xcodz-dot <71920621+xcodz-dot@users.noreply.github.com>
* Adding __str__() function * Removing white space * Update data_structures/linked_list/__init__.py Co-authored-by: xcodz-dot <71920621+xcodz-dot@users.noreply.github.com> * Adding type hints * Update __init__.py * Update __init__.py * Adding the changes requested * Updating to fix pre-commit * Updating __init__.py * Updating __init__.py Co-authored-by: xcodz-dot <71920621+xcodz-dot@users.noreply.github.com>


Describe your change:
Added a str() function to the Linked List class that will print the contents in the Linked List with arrows that point to the next value
see: #3960
Checklist:
Fixes: #{$ISSUE_NO}.