CS50P - Lecture 8 - Object-Oriented Programming

Sdílet
Vložit
  • čas přidán 11. 06. 2024
  • This is CS50P, CS50's Introduction to Programming with Python. Enroll for free at cs50.edx.org/python. Slides, source code, and more at cs50.harvard.edu/python. Playlist at • CS50's Introduction to... .
    TABLE OF CONTENTS
    00:00:00 - Introduction
    00:00:24 - Object-Oriented Programming
    00:01:00 - Tuples
    00:18:39 - Dictionaries
    00:26:45 - Classes and Objects
    00:39:18 - Instance Methods
    00:59:49 - Validating Attributes
    01:04:25 - The String Method
    01:11:13 - Custom Methods
    01:15:33 - Properties, Getters and Setters
    01:38:49 - Types and Classes
    01:47:23 - Class Methods
    02:17:29 - Inheritance
    02:31:59 - Operator Overloading
    An introduction to programming using a language called Python. Learn how to read and write code as well as how to test and "debug" it. Designed for students with or without prior programming experience who'd like to learn Python specifically. Learn about functions, arguments, and return values (oh my!); variables and types; conditionals and Boolean expressions; and loops. Learn how to handle exceptions, find and fix bugs, and write unit tests; use third-party libraries; validate and extract data with regular expressions; model real-world entities with classes, objects, methods, and properties; and read and write files. Hands-on opportunities for lots of practice. Exercises inspired by real-world programming problems. No software required except for a web browser, or you can write code on your own PC or Mac.
    Whereas CS50x itself focuses on computer science more generally as well as programming with C, Python, SQL, and JavaScript, this course, aka CS50P, is entirely focused on programming with Python. You can take CS50P before CS50x, during CS50x, or after CS50x. But for an introduction to computer science itself, you should still take CS50x!
    ***
    HOW TO SUBSCRIBE
    czcams.com/users/subscription_c...
    HOW TO TAKE CS50
    edX: cs50.edx.org/
    Harvard Extension School: cs50.harvard.edu/extension
    Harvard Summer School: cs50.harvard.edu/summer
    OpenCourseWare: cs50.harvard.edu/x
    HOW TO JOIN CS50 COMMUNITIES
    Discord: / discord
    Ed: cs50.harvard.edu/x/ed
    Facebook Group: / cs50
    Faceboook Page: / cs50
    GitHub: github.com/cs50
    Gitter: gitter.im/cs50/x
    Instagram: / cs50
    LinkedIn Group: / 7437240
    LinkedIn Page: / cs50
    Medium: / cs50
    Quora: www.quora.com/topic/CS50
    Reddit: / cs50
    Slack: cs50.edx.org/slack
    Snapchat: / cs50
    SoundCloud: / cs50
    Stack Exchange: cs50.stackexchange.com/
    TikTok: / cs50
    Twitter: / cs50
    CZcams: / cs50
    HOW TO FOLLOW DAVID J. MALAN
    Facebook: / dmalan
    GitHub: github.com/dmalan
    Instagram: / davidjmalan
    LinkedIn: / malan
    Quora: www.quora.com/profile/David-J...
    TikTok: / davidjmalan
    Twitter: / davidjmalan
    ***
    CS50 SHOP
    cs50.harvardshop.com/
    ***
    LICENSE
    CC BY-NC-SA 4.0
    Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License
    creativecommons.org/licenses/...
    David J. Malan
    cs.harvard.edu/malan
    malan@harvard.edu

Komentáře • 340

  • @sabouraram5628
    @sabouraram5628 Před 3 měsíci +52

    Having spent over 100 hours across various paid and free resources, nothing matches the unique teaching style and enthusiasm of Professor David Malan. His passion and approach to teaching are truly remarkable. What makes this course unique is how he gradually sets the stage for different concepts. CS50 is absolutely the best course to learn Python.

  • @WarbossPepe
    @WarbossPepe Před rokem +45

    How does this man have so much energy and focus to shoot at 2 hour 50 minute lecture. Incredible.

    • @CherifRahal
      @CherifRahal Před 5 měsíci +8

      it's more then that with the cuts and some edits

    • @matthewbailey6234
      @matthewbailey6234 Před měsícem +1

      Unbelievable. He still looks fresh at the end! He was surely taking breaks?!!! The level of teaching on this course is so high, really carefully guides and enthuses the viewer. Very grateful to have free access.

  • @nobertwekesa8923
    @nobertwekesa8923 Před rokem +293

    CS50 is best course out there. Malan is the best teacher I've seen . His understanding on OOP and python in general is outstanding. How lucky are these harvard students

    • @influensor
      @influensor Před rokem +6

      He is!

    • @timothykahil8007
      @timothykahil8007 Před rokem +80

      How lucky are we they put it online for free also. I love David!!

    • @abbagarba1
      @abbagarba1 Před rokem +15

      Malan in my language is called teacher. He is a really great Malan I learned a lot from him. Thanks 🙏

    • @sayori3939
      @sayori3939 Před rokem +3

      @@mythbuster6126 I've completed like 7 or so 3 of them were related to programming and for me he is the best teacher tied with anither teacher but since they taught completely different things I can't quite compare them

    • @davidjmalan
      @davidjmalan Před rokem +38

      Thank you!

  • @mehreentabassum1474
    @mehreentabassum1474 Před rokem +26

    The best thing that happened to me this year is CS50.

  • @javierdemendonca257
    @javierdemendonca257 Před rokem +78

    Wow David got so passionate on this one that he almost had no voice to say "This was CS50". Such enthusiasm, im so glad this got to be my first programming course ever. Thank you thank you!

  • @alainrouleau
    @alainrouleau Před měsícem +10

    I've been using OOP and objects for years in Python. Still learned quite a lot. Great introductory video. So, thanks!
    For those who may feel a little discouraged about objects, don't worry. It's one of those things where a lightbulb has to go off and then you're like wow, now I understand. And you won't be able to control yourself, lol.
    Few suggestions to help out:
    • Focus on concepts, not syntax
    • Concepts are too simple, that's why it's hard, it just instances
    • Everything is an object including the space above your head, date/times, parking spots, lanes on a highway, a web page
    • Objects are responsible for their own methods which means it's not a mechanic that changes the oil on a car, it's the car itself that changes it's own oil
    • Objects are composed of other objects like a Car() which has 4x Wheel()
    • Extremely important, all the data & functionality travels with the object (known as encapsulation). So, you don't keep a separate birthday list for family members. You ask the instance of the Grandma() object directly if it's her birthday. She's responsible for knowing, not you.
    Fun example... Create 100x Casino() with 50x Table() with 1x Shoe() of 8x Deck() of 52x Card(). Randomly distribute the 40,000 deck of cards amongst the casinos and various tables. Shuffle the cards for each shoe. And oh ya, each card has a unique serial number. And card #888 of 2 million+ is defective and needs to be replaced. Find the casino and table where card #888 is located. Thats the power of OOP.

    • @abdqasrawi
      @abdqasrawi Před 29 dny

      can you tell me what's the concept behind self?
      and why to create instances like self.name = name instead of just name

    • @lepidoptera9337
      @lepidoptera9337 Před 28 dny

      @@abdqasrawi self refers to the instance of the class you are in. self.name is the variable name that belongs to that instance. In a real OOP language classes define private name spaces that can not be accessed from the outside of the class. Python is not such a language. It does not (and probably can not by design) isolate variables and methods of a class. That makes OOP in Python basically useless from an architect's point of view. The language simply does not check for programming errors that may result from external modifications of class variables. In C++, Java etc. such checks happen, which can be useful if you are dealing with novice and undisciplined programmers. Python assumes that you are a grownup and that you don't need such nanny measures.

  • @yqhanliving
    @yqhanliving Před 4 měsíci +9

    This was soooo good. This class took me longer than any other previous CS50P classes, but it was worth it. I love the metaphors, they are vivid and to the point. Having took CS50P for more than a month now, this course has certainly grown on me. Sometimes, when I feel down or upset in life, watching David's teaching just gives me a sense of order and inspiration. And the problem sets are equally fun, engaging and challenging. Just want to say a big thank you to the whole CS50 team.

  • @user-if8zh4eq8b
    @user-if8zh4eq8b Před 10 měsíci +24

    I nearly use about 6 hours to finish this OOP class. David malan explains so carefully and the example is well-designed. In some part of this video I watched it again and again. the best class in CS50P

  • @shakeelahmed07
    @shakeelahmed07 Před 9 měsíci +10

    Thank you so much Harvard for keeping this treasure trove for free on CZcams available for everyone. Dear Sir David J.Malan , your energy and enthusiasm just flows like a Lava when you teach and you're the best instructor I have ever seen ❤.

  • @adfinemrising
    @adfinemrising Před rokem +42

    extremely engaging way to teach programming. i wish all teachers are like this. very precise, articulate, consistent and masterful. especially at the end. the most difficult concepts to comprehend (on your own) were explained like they were nothing. this guy is my hero

    • @sayori3939
      @sayori3939 Před rokem

      Anither quality of him is hoe he teaches new information with an actual context like in the cs50x when he talked about sql, I've never understood the point of sql but the way he build up the lecture (talking about csv, how variables don't hold info etc) actually made me feel the need to use that, that's a huge deal in programming, you have to feel the need to use something for some problem if raw information is presented to you without a context you'll probably forget about it in no time

  • @Neojs565
    @Neojs565 Před rokem +13

    Woww ! I'm doing mentally high five. I'm glad I found CS50. The teaching skill is exceptional ! Thank you so much !!

  • @hafsirayen4508
    @hafsirayen4508 Před rokem +16

    Dear David,
    I just watched your video on OOP and I finally understand it. Your clear explanation and examples made all the difference. Thank you so much for sharing your knowledge with us. Your teaching has made a big impact on my learning and I am grateful for it.
    Best regards, from tunisa

    • @davidjmalan
      @davidjmalan Před rokem +7

      So glad you found the material helpful!

  • @DeejayManiaNYC
    @DeejayManiaNYC Před rokem +41

    I started my computer science journey with watching CS50 videos over two years ago, nowadays I'm using them to quickly brush up on concepts. Either way, CS50 changed my life :')

    • @Safar_Galimzyanov
      @Safar_Galimzyanov Před rokem +1

      How is it going?

    • @lepidoptera9337
      @lepidoptera9337 Před 11 měsíci +3

      @@Safar_Galimzyanov He is still posting bullshit on the internet while working as a cab driver. How do you think it's going? ;-)

    • @lepidoptera9337
      @lepidoptera9337 Před 9 měsíci +1

      @@andoryus I am simply calling bullshit when I see bullshit. There is just an awful lot of bullshit on the internet. ;-)

    • @yulana990
      @yulana990 Před 3 měsíci +2

      @@lepidoptera9337 Someone who studies CS watching a free CS course from Harvard, is somehow ''bullshit''? Please, get a grip.

    • @lepidoptera9337
      @lepidoptera9337 Před 3 měsíci

      @@yulana990 He is watching videos on CZcams. That's not studying. Studying is when you are living it 24/7 at a university. I did teach CS as a grad student, by the way. You would not have passed our CS 101 exams with the materials that you can find online. Not even close.

  • @WalkingEng
    @WalkingEng Před 9 měsíci +1

    Just amazing, I’ve been trying to understand OOP for a while and here it is all explained brilliantly by David and his team. The learning cycle isn’t complete without some practice and application, so that’s what next with the assignments and my own programming needs. Many Thanks for the incredible generosity in sharing these lectures.

  • @thetwinsuns4375
    @thetwinsuns4375 Před 9 měsíci +5

    How did Mr. Malan manage to speak for 3 hours straight while giving us a thorough understanding of the topic? mind blowing

  • @brucebergkamp
    @brucebergkamp Před rokem +18

    David is such a legend as he is able to understand / decipher what his students are asking. i had a hard time understanding them :/

  • @ifeadeagbo
    @ifeadeagbo Před 11 měsíci +1

    I have been struggling to understand OOP for days now, but David just made my year! This Man is amazing

  • @vinhnghiang1273
    @vinhnghiang1273 Před rokem +2

    the magic is he's saying the same thing that a lot of youtubers do, but his expression somehow make it so easy to understand !!!!!!!! It's magic !

  • @absadiq702
    @absadiq702 Před rokem +5

    The best teacher I've seen so far.

  • @ugestacoolie5998
    @ugestacoolie5998 Před rokem +2

    this class was awesome! I did watch videos on OOP before but none of them explained it as clear and oral as you did, thank you david!

  • @yonghuidong888
    @yonghuidong888 Před rokem +8

    This teacher is literally AMAZING!!!

  • @kylofps
    @kylofps Před rokem +5

    I'm super grateful for this class and it's availability for students online! His teaching is super inspiring :)

  • @danielarledge7017
    @danielarledge7017 Před rokem +4

    this guy is a phenomenal instructor

  • @ydairy
    @ydairy Před rokem +3

    This one was so good. I feel like I am finally comfortable creating classes and implementing them in my code.

  • @BieStrings
    @BieStrings Před 4 měsíci +23

    Anybody else feel like this was the hardest lecture to understand to date?

    • @raiyan9956
      @raiyan9956 Před 2 měsíci +4

      man i have already watched it twice and it still feels equally hard 😥. Although i've watched the regex video in 2x speed and that was very easy, but this topic is something

    • @matthewbailey6234
      @matthewbailey6234 Před měsícem

      Yeh v much so

    • @adam_belounis.
      @adam_belounis. Před měsícem +1

      Absolutely

    • @kellzbaker
      @kellzbaker Před měsícem

      ​@@adam_belounis.search up Corey Schafer watch his videos of first class variables then closures then decorators then his playlist of 6 videos on object oriented programming . You'll gain a better understanding trust me

    • @kellzbaker
      @kellzbaker Před měsícem +1

      search up Corey Schafer watch his videos of first class variables then closures then decorators then his playlist of 6 videos on object oriented programming . You'll gain a better understanding trust me​@@adam_belounis.

  • @GG-uz8us
    @GG-uz8us Před rokem +8

    CS50 rocks! The author of Harry Potter would never expected her story provide an perfect example for OOP.

  • @catocross9542
    @catocross9542 Před rokem +6

    David is a world class educator who must surely be in the top 0.5% of python teachers on this Earth. Add that to the greatest practice labs of any python course on Earth and it becomes an undeniable fact that this is the best python course that exists anywhere on this planet.

  • @user-gm3oh5hz5k
    @user-gm3oh5hz5k Před rokem

    З Днем викладача! Щирі побажання найкращому Вчителю.

  • @pdrck
    @pdrck Před 9 měsíci +8

    3h of energy and passion. Obrigado David 💛💚

    • @MassitaTonolli
      @MassitaTonolli Před 9 měsíci +2

      Huehuehuehuehue brbrbrbrbr Valeu!

    • @5hitao
      @5hitao Před 9 měsíci +1

      Chama que chama chama
      Bora rodar uns code brbrbrbrbrbrbrbr

  • @digigoliath
    @digigoliath Před rokem +2

    Awesome lecture. Wonderful teacher & teaching!!

  • @lamlamnguyen7093
    @lamlamnguyen7093 Před 5 měsíci +1

    Thank you guys for delivering these awesome lectures and bringing knowledge to others. I'm so grateful that I was born into this era, where such precious knowledge is handed for free.

  • @AlzyWelzy
    @AlzyWelzy Před 3 měsíci

    Thank You, CS50P Team.
    You guys are the best. I love you all.

  • @necromancerbb
    @necromancerbb Před 7 měsíci

    its amazing to see some of the questions the students are coming up with. Very interesting questions raised towards the end that gave even David some pause. Perfect critical thinking on part of the students.

  • @muhammadumarsotvoldiev9555

    Thank u a lot for sharing knowledge in a very interesting way!!!

  • @kadirv
    @kadirv Před 3 měsíci

    Thank you Prof Malan for a detailed session on strong fundamentals. 👏

  • @Thanos-Cassoulet
    @Thanos-Cassoulet Před rokem

    so much free content thats amazing tysm. TY Malan for all your amazing lectures

  • @onzamono
    @onzamono Před rokem +1

    I loved this. I knew the theory, but it made me understand some concepts better.

  • @jaehyi2009
    @jaehyi2009 Před rokem +3

    This man knows how to teach! 👏

  • @zy9dh
    @zy9dh Před rokem +2

    this man has taught me so much

  • @MrWardo2009
    @MrWardo2009 Před rokem

    Learned so much from Dr Malan's lecture!

  • @lcminformatica7410
    @lcminformatica7410 Před rokem

    Nice tutorials is much more simple than I thought

  • @maellet5747
    @maellet5747 Před rokem +5

    ❤️ CS50 Lectures

  • @yli6050
    @yli6050 Před 12 dny

    Beautifully taught ❤impeccable

  • @shis10
    @shis10 Před rokem +1

    Excellent Video Sir ..💜

  • @RookieUyoku
    @RookieUyoku Před rokem +1

    Excellent course.

  • @Manishkumar-ww4gm
    @Manishkumar-ww4gm Před rokem

    Very Informative session.

  • @moody_moon_coder
    @moody_moon_coder Před rokem

    The greatest professor ever!

  • @Andrumen01
    @Andrumen01 Před rokem +1

    You are very engaging!

  • @codewithnyamboks
    @codewithnyamboks Před rokem +2

    I loved this class 😍😍

  • @pstefanics
    @pstefanics Před rokem +6

    Note that from about 1h 14 minutes into the video, if you don't have Python 3.10 or higher, you'll get a "SyntaxError: invalid syntax" for the match self.patronus: line since Python 3.9 and below DOES NOT support the match/case syntax

  • @wilhelmngoma9009
    @wilhelmngoma9009 Před rokem

    Thanks. Very great class

  • @GenZ_01_
    @GenZ_01_ Před 6 dny

    Cs50 team you’re the best❤

  • @user-wc6cd3jn9w
    @user-wc6cd3jn9w Před rokem

    Здорово! Складна тема дуже доступно викладена

  • @devanshdwivedi4636
    @devanshdwivedi4636 Před rokem +2

    Man needed OOP for exams ..the premiere came in clutch 😂💞💞

  • @nicomal
    @nicomal Před 11 měsíci

    I wish I could give more than one thumbs up, take my fingers and toes too... What a legend David is!!

  • @georgejaniec4995
    @georgejaniec4995 Před rokem +26

    The best explanation of the OOP out there. I like the way it has been structured. Thank you🙇 CS50P!

    • @coderider3022
      @coderider3022 Před rokem +1

      I disagree, inheritance for example shouldn’t be mentioned like they way he describes it and will lead inexperienced people to create tight coupling, overly nested hierarchies and overlook some of the SOLID principles. They are better points to start from, not some contrived person example. Go study any respected GitHub repo and see how it’s used or not rather.

    • @georgejaniec4995
      @georgejaniec4995 Před rokem

      @@coderider3022, sure I will take a look. Thanks for your reply!

    • @MrDante1947
      @MrDante1947 Před rokem

      @@coderider3022 Do you have any good GitHub Repo for recommandation

    • @sayori3939
      @sayori3939 Před rokem +1

      @@MrDante1947 lol and then he never replies again, that's what you get yo pay attention to people who always criticize others without showing proofs and yeah people with no programming experience will surely learn looking someone else's code used in specific context, and in fact when there's so many code samples from all different sources why bother watching a video right best advice nothing can go wrong

    • @essayedgar
      @essayedgar Před rokem +1

      @@sayori3939 Yeah ikr, David J Malan is literally a harvard professor with decades of experience in Computer Science but some random guy that's been programming for 3 weeks always knows better somehow

  • @linukabineth5142
    @linukabineth5142 Před rokem +1

    *Massively helpful👌*

  • @reihanehmirjalili7467
    @reihanehmirjalili7467 Před měsícem

    Amazing video!

  • @Clay286
    @Clay286 Před rokem +1

    I feel like standing under a waterfall of his energy, knowledge and enthusiasm! So so so awesome!!! Thank you so much David! It's a kind of magic!
    Btw, what's David's patronus?

  • @pongsaktachawatanalertkit8480

    You are the best teacher

  • @benshomer2940
    @benshomer2940 Před 7 měsíci

    such a good explanation

  • @AnselmWiercioch
    @AnselmWiercioch Před 6 měsíci +1

    This IS a lot of syntax in one shot. More of the step-by-step walking through what the code is supposed to be doing as in previous lectures would be helpful to encourage understanding. I'm sure that would add some time, but at 2:47, it's already almost worth breaking into two lectures.

  • @cs50memepage2
    @cs50memepage2 Před rokem +3

    Think positively

  • @Pushpak.
    @Pushpak. Před rokem +4

    CS50 team you aur doing great work Adding value in our life
    Iam a new subscriber in your channel and i will continue this searies after my MHTCET PCM This is a state level Exam and get admission in CSE it take around a month because my exam is in 11th August 2nd shift

  • @mateoherrera1413
    @mateoherrera1413 Před 8 měsíci

    Malan you are a great teacher.

  • @Kuji535
    @Kuji535 Před 8 měsíci

    tysm for these coursess their really useful :D

  • @JulioSantirachi
    @JulioSantirachi Před 9 měsíci

    This is excellent!

  • @user-dz8mr3nz7z
    @user-dz8mr3nz7z Před 3 měsíci

    Thank you Prof Malan❤

  • @ramonrochadev
    @ramonrochadev Před 8 měsíci

    This guy is amazing ❤

  • @ardin222
    @ardin222 Před rokem +9

    Hello friends, I hope you are at your best time ever.
    CS50 has been one of the best courses I have attended so far. 👍
    unfortunately this part is very difficult for me, even though I have watched this video many times, but I still cannot solve the problems of this lesson.
    I don't know how to get through this part !!!🚑🚒🚑🚒🚑🚒

    • @akish933
      @akish933 Před rokem +6

      There is a community on discord and people are very helpful with each problem set. Check it out!

  • @paris_mars
    @paris_mars Před rokem

    Such a great teacher and such a great course. I've learned so much watching the lectures and working through the problem sets. I'm so happy this is a thing.

  • @zeeinfo2726
    @zeeinfo2726 Před rokem

    Thank you so much this was expected.. 😇

  • @bandaruswamy9291
    @bandaruswamy9291 Před rokem +1

    Pretty good cs50

  • @mirshodoripov1035
    @mirshodoripov1035 Před rokem

    thank you much Malan

  • @PranayCoding
    @PranayCoding Před rokem

    Such an awesome class 🙏❤️

  • @BerkGoknil
    @BerkGoknil Před měsícem

    If you're scared of OOP, watch it from start to finish, you'll see how easy it is. One of the few teachers in the world. God bless you, David.

    • @lepidoptera9337
      @lepidoptera9337 Před 28 dny

      It's easy and it's the wrong way of looking at software, too. ;-)

  • @ryu467168
    @ryu467168 Před rokem +1

    21:16 da audio decrypting scene's incredible

  • @prateekmishra9752
    @prateekmishra9752 Před rokem

    Hats off to David

  • @GodsNewLaw
    @GodsNewLaw Před rokem

    love you guys

  • @HairoHeria
    @HairoHeria Před 20 dny

    by far the hardest lecture week so far. I'm having difficulty trying to understand the concept of OOP. Probably will take a look at another sources on this OOP concept.

  • @fabio.1
    @fabio.1 Před 5 měsíci

    I'd love Java classes taught by David

  • @ioakeimhadjimpalasis2569

    Since instance variables cannot be private in python, could this mean that software is more vulnerable to attacks compared to software made with other languages?

  • @evachen4709
    @evachen4709 Před 7 měsíci

    David Malan is as awesome as always.

  • @MOMO-YYDS
    @MOMO-YYDS Před 4 měsíci

    PERFECT

  • @daveyu9869
    @daveyu9869 Před rokem

    woww! leanr a lot!!

  • @omarsalkhadi824
    @omarsalkhadi824 Před 8 měsíci

    We’re so lucky listening to the G.O.A.T.

  • @isitool8
    @isitool8 Před 9 měsíci

    Damn... my head is scrambled after this one

  • @PratikAman
    @PratikAman Před 11 měsíci

    I evolved from Pikachu to Raichu in the python world after this lecture . Thanks professor.

  • @sharif_billa
    @sharif_billa Před rokem

    Thanks 😭😭

  • @aloewishus
    @aloewishus Před rokem +1

    could i make a suggestion? When students ask questions use an overlay in the upper right /lower right corner instead of blanking out the whole screen.
    It is a bit jarring when focusing on the code and listening.
    🥰love the videos thank you.

  • @nehakachewar4201
    @nehakachewar4201 Před rokem

    Can a seg-fault or some sort of overflow error be generated if I create too many objects from a class?

  • @tomasbinaghi8736
    @tomasbinaghi8736 Před rokem +4

    Can someone help me undrestand a change in the code?
    At 1:15:20, david writes the "charm" method, using match to figure out which emoji to return.
    However a bit after that, while he shows the code, it's shown to have been changed to use a series of conditionals instead.
    There's probably been some editing of the video but I still wouldn't understand the reasoning by which to choose a specific path to code the method.
    Thanks in advance!

    • @nikitarasskazov4715
      @nikitarasskazov4715 Před rokem +1

      case is just an alternative way to check multiple cases for matching values. the long way would be chains of if/elif/else. explanation is in the first lecture here: czcams.com/video/_b6NgY_pMdw/video.html
      the change in code here is due to editing of the video, there were unedited lectures on this channel where he corrects or modifies minor stuff on the go and then it is edited down

    • @tomasbinaghi8736
      @tomasbinaghi8736 Před rokem

      @@nikitarasskazov4715 thanks a lot!

  • @qianwang8639
    @qianwang8639 Před rokem +5

    I took CS50X already, but I still found this lecture 8 is hard to understand for me 😭

  • @trinxic-music1469
    @trinxic-music1469 Před 4 měsíci

    1:38:00 would it be possible to create some type of seed and then use that instead of an underscore? [somehow create a private seed/key] and then use the exec() function to implement that seed within the variable -> exec(f"student.{seed}house = {house})

  • @uniatrix
    @uniatrix Před 8 měsíci

    2:12:31 to 2:13:22 David always crack me up at this part

  • @Jourvence777
    @Jourvence777 Před 5 měsíci

    This was an interesting night

  • @wilson6405
    @wilson6405 Před rokem

    Nice class. Help me to review the OOP.

  • @yeadahmed9165
    @yeadahmed9165 Před 9 měsíci

    lovely

  • @pramodkamble3644
    @pramodkamble3644 Před rokem

    how to get class variables inside the instance method?

  • @muzammilomarzoy6616
    @muzammilomarzoy6616 Před 9 měsíci

    00:18:39 - Dictionaries
    00:59:49 - Validating Attributes
    1:34:00 day 3
    2:03:00 day 4