Could you teach me why this code is not running?

+1 vote
asked Aug 29 by Yungsil lee (220 points)
def show_list(slist):
    if slist.empty():
        print('The list is empty')
        return
    for i in range(slist.size()):
        print(slist.search_pos(i), end = '    ')

if __name__=="__main__":
    slist=Linked_list( )
    print("the number of data: {}".format(slist.size()))
    show_list(slist)
    print()

    slist.append(2)
    print("the number of data: {}".format(slist.size()))
    show_list(slist)
    print()

if slist.remove(2):
   print("the number of data: {}".format(slist.size()))
   show_list(slist)
   print()

2 Answers

+1 vote
answered Aug 30 by LiOS (4,660 points)
Is there additional code not included above? The Linked_list() function has not been defined - this is because the function hasn't perhaps been declared or imported.

If you can include the user defined code for Linked_list() function or include the importing of the library where Linked_list() is imported from etc, hopefully someone will be able to help.
commented Sep 2 by Yungsil lee (220 points)
I'll study and thinking base on your answer. thank you!
–3 votes
answered Sep 1 by Shailja Rana (160 points) 3 flags
You are not writing correct because you are fool
commented Sep 2 by Yungsil lee (220 points)
Thank you for your kind answer!
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...