Return to Video

Is Self Important - Programming Foundations with Python

  • 0:00 - 0:02
    So thus far what we have done, is we have
  • 0:02 - 0:05
    defined the class Movie and then we went ahead and defined
  • 0:05 - 0:09
    a couple of instances of that class, namely Toy Story and
  • 0:09 - 0:13
    Avatar. Next, what I want to do is I want to
  • 0:13 - 0:16
    run a quick little part experiment which is, what do you
  • 0:16 - 0:19
    think will happen if I remove the keyword self. From in
  • 0:19 - 0:22
    front of one of the instance variables. So let me just
  • 0:22 - 0:25
    go ahead and do that right now. [SOUND] There. Now I
  • 0:25 - 0:28
    want to think about this question. Here is the code for
  • 0:28 - 0:31
    the class Movie one more time, and this is the self
  • 0:31 - 0:33
    I'm wanting to remove from in front of storyline. And I
  • 0:33 - 0:36
    want you to think about this question especially in the context
  • 0:36 - 0:41
    of running this code, which is print(avatar.storyline). Once you have a
  • 0:41 - 0:45
    hypothesis, I want you to enter it in this box. After
  • 0:45 - 0:48
    you've submitted this response, I want you to make this change
  • 0:48 - 0:51
    on your own computer and see if your hypothesis matches your result.
Tytuł:
Is Self Important - Programming Foundations with Python
Opis:

more » « less
Video Language:
English
Team:
Udacity
Projekt:
UD036 - OOP
Duration:
0:53

English subtitles

Revisions Compare revisions