Getters and Setters

Поділитися
Вставка
  • Опубліковано 28 вер 2024
  • MIT 6.0001 Introduction to Computer Science and Programming in Python, Fall 2016
    View the complete course: ocw.mit.edu/6-0...
    Instructor: Dr. Ana Bell
    This in-class question explains how and why class attribute getters and setters are important in Python.
    License: Creative Commons BY-NC-SA
    More information at ocw.mit.edu/terms
    More courses at ocw.mit.edu

КОМЕНТАРІ • 15

  • @bluesdog88
    @bluesdog88 3 роки тому +5

    does def refer to "define" ?

    • @mvisperas
      @mvisperas 3 роки тому +3

      Yes. You use "def" to define a function (method).

    • @bluesdog88
      @bluesdog88 3 роки тому +1

      @@mvisperas Thanks, that's what I though ;)

    • @mvisperas
      @mvisperas 3 роки тому +2

      @@bluesdog88 That means you can no longer use def as a variable as it is now a reserved word. I normally use abc, then def as variables to create a small code to test an idea. Now I can no longer use def at least for python.

    • @bluesdog88
      @bluesdog88 3 роки тому +2

      @@mvisperas yep just curious, it made the most sense, just thought i'd ask someone lol

  • @randomguy75
    @randomguy75 7 років тому +12

    I can't believe that she uses windows.

    • @shashwattripathi759
      @shashwattripathi759 6 років тому +20

      what's wrong with windows?

    • @khaki714
      @khaki714 5 років тому +5

      @@shashwattripathi759
      It's lame

    • @vvov935
      @vvov935 5 років тому +30

      I can't believe you can't believe that.

    • @ultralooter
      @ultralooter 5 років тому +14

      Computer Scientists are actually focused on research and lecturing rather than obsessively installing repo's like Arch...

    • @SebastianSanchez65
      @SebastianSanchez65 4 роки тому

      it’s just for presentation purposes, she very well could use linux on her workstation