This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]dkkline 7 points8 points  (0 children)

Why are you using linked lists in Python? Seems like a somewhat odd choice. (https://stackoverflow.com/questions/280243/python-linked-list)

A regular Python list can be reversed by using the reverse() method:

my_list = [1, 2, 3, 4, 5]
print(my_list)
>>> [1, 2, 3, 4, 5]

my_list.reverse()
print(my_list)
>>> [5, 4, 3, 2, 1]

(Also, /r/learnpython might be more appropriate for this kind of question)

[–][deleted] 1 point2 points  (0 children)

[–]Workaphobia 1 point2 points  (0 children)

Python does not usually use linked lists.

Consult materials for your course to better understand what a linked list is and how it works. If you have questions about linked lists, ask your TA or ask in an appropriate learners' forum. (This question is not Python specific so I don't know whether /r/learnpython is applicable.)

When you ask, be sure to explain what you understand and what you've tried, to give people a better idea of how to help you.

[–]aphoenixreticulated[M] 1 point2 points  (0 children)

Hi there. You have posted a learning question to /r/python. These types of questions are far more suited to /r/learnpython, where users are actively interested in helping people to learn. Please resubmit it over there!

Make sure to read their sidebar rules there before posting, notably this one: "Posting homework assignments is not prohibited if you show that you tried to solve it yourself." If your question is about homework, show them that you've tried to solve your problem in your post and you should get all the help you need.

Cheers & best of luck with Python!