Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Lists topic python
i been told to post it as new question in here. I am beginner on python and wanted some help to see if i am doing the right thing below and the next step to take with this thanks.

This is the question:

Create a simple list to hold the items 1,2,3,4, creating the list “from the front” as in Slide 48.[Notice how the list is only complete when you have finished.]Use the code from Slide 50 to print out your list. (You may want to write this as a function.)

class Node:

start = Node()
point = start = 1 = Node()
point = = 2 = Node()
point = = 3 = Node()
point = = 4 = None

def func1():
point = start

point =

point =

point =
point =
print("point:", point)


Also, did i assemble the code properly that i got from the slide 48 and 50(read question)
Without access to the slides tough to tell, but this produces a linked list of objects, each object with a pointer to the next and containing a value in the attribute "data".
and the slides are?
The slides are 87 pages long and mostly talking about lists and looks more like walkthrough that doesn't make sense to me that much to be honest. if there is something specific for me to look for i can do that.
unable to proceed without mentioned slides
(Oct-14-2019, 08:06 PM)Larz60+ Wrote: unable to proceed without mentioned slides

Oh the mentioned slides 48 and 50 you mean? Thought you meant other slides. It had these code on them i just tried to put them together, the slide 48 was the Class Node one and the slide 50 was def funct1() whats below it , i just added function to open and closed for slide 50 or thats what i tried to do.
So, is everything between def func1(): and the call to the function supposed to be indented so as to define the function?
Also, for your class, don't you need to indent "pass"?
Fixing the indentation your code works.

Top Page

Forum Jump:

Users browsing this thread: 1 Guest(s)