CS50x 2024 - Lecture 6 - Python

Поделиться
HTML-код
  • Опубликовано: 27 ноя 2024

Комментарии • 256

  • @jrb65
    @jrb65 9 месяцев назад +219

    What an amazing professor. Not a single boring moment .

  • @justanothernothuman
    @justanothernothuman 6 месяцев назад +343

    "Malloc is gone, pointers are gone, free is gone!" thanks to the lord !

    • @jeannoelhonisch7037
      @jeannoelhonisch7037 6 месяцев назад +9

      100%

    • @kennessu4642
      @kennessu4642 6 месяцев назад +19

      used to pray for times like these

    • @pratyush842
      @pratyush842 5 месяцев назад +3

      My dream

    • @NOOR-dy6yn
      @NOOR-dy6yn 4 месяца назад +11

      waiting for : coding gone ...

    • @ZerubbabelT.
      @ZerubbabelT. 4 месяца назад +8

      @@NOOR-dy6yn Maybe next week when AI arrives😄

  • @gauravrawat.7
    @gauravrawat.7 4 месяца назад +41

    00:02 Transition from C to Python
    03:11 In Python, programs no longer need to be compiled before running, unlike C programs.
    07:11 Python allows escaping of apostrophes and offers quicker implementation for real work.
    09:19 Defining functions and manipulating sets of words in Python
    13:41 How to blur an image using Python and PIL library
    15:54 Python makes solving problems more efficient and readily.
    20:16 Python's popularity and CS50's goal to teach programming
    22:05 In Python, you import the name of the library instead of including a .h file, allowing for more precise control over the specific functions you want to use.
    25:49 Python provides three ways to concatenate strings.
    27:57 Different ways of concatenating strings in Python
    31:50 Python makes variable declaration and manipulation simpler.
    33:54 Python simplifies variable types for ease of use.
    37:43 Input from keyboard is treated as strings in Python
    39:52 Converting x and y to integers in Python using int() function.
    43:43 Importing libraries and avoiding function collisions in Python.
    45:45 Python uses indentation instead of curly braces for code blocks
    49:32 Python strings behave differently than in C
    51:33 Python is meant to be higher-level and more accessible.
    55:43 Designing a solution for handling Y and Yes without capitalization.
    57:40 Strings in Python come with built-in functions for operations like uppercase, lowercase, etc.
    1:01:46 Introduction to using loops in Python
    1:03:42 Python uses a more concise syntax for looping compared to C.
    1:07:23 Python makes looping easier than C using iterable objects.
    1:09:23 Python's print() function can customize line endings.
    1:13:42 Introducing loops and creating functions in Python
    1:15:29 Defining and calling a custom function in Python
    1:19:24 Enhancing function implementation with parameters in Python
    1:21:13 Python handles truncation differently than C
    1:25:00 Python has advantages over C in handling floating point precision and integer overflow.
    1:26:57 Introduction to using functions in Python
    1:30:51 The get_int() function in Python involves input, conversion to integer, and exception handling for ValueError.
    1:32:41 Handling exceptions in Python and using loops to create Mario-like structures
    1:36:32 Using loops and Pythonic implementation
    1:38:36 Python lists automatically handle memory and are like linked lists
    1:42:30 Python allows for easy manipulation of lists using built-in functions and methods.
    1:44:38 Adding lists in Python and linear search
    1:48:20 Python allows for efficient searching and data storage using dictionaries.
    1:50:25 Creating a list of dictionaries in Python
    1:54:35 Python uses square brackets with strings to access dictionary instead of dot notation used in C.
    1:56:26 You can simplify dictionaries and use single quotes to avoid mixing double quotes in Python.
    2:00:44 Using command-line arguments and sys library in Python
    2:02:44 Using sys module in Python for command-line arguments and program exits.
    2:07:01 Creating QR code in Python.

  • @neclis7777
    @neclis7777 8 месяцев назад +65

    Incredible teacher, as much a stand up performer as an expert in his field. What energy he puts in his work ...

  • @bassycounter
    @bassycounter 7 месяцев назад +46

    “I apologize if you’re harboring resentment that this wasn’t a week earlier” 😂It’s okay professor, I have accepted that to understand programming and computer science better, I must dive into lower level stuff occasionally, week 5 was tough but I persevered!

  • @mtarik0
    @mtarik0 9 месяцев назад +29

    57:18 What a beautiful way to explain what OOP is in basic terms!

    • @bekay7663
      @bekay7663 9 месяцев назад +6

      it might because of my little knowledge of OOP previously before starting the course or the Weeks leading up, but in that 5 minute segment I fully understand object oriented programming, or at least have a solid grasp of it.

    • @mtarik0
      @mtarik0 9 месяцев назад

      That's awesome! I do believe that playing around with C language first makes the transition much better.
      I started learning programming with Java, and even though our instructors explained us the OOP term in similar ways, we as learners sort of took it for granted. It was because we didn't know what it was like a variable not having built-in functionalities, its advantages, etc. This is why I love CS50 :)
      Since you feel like as such, you will probably have an easy time of understanding encapsulation, inheritance and the like, best of luck! @@bekay7663

  • @emiliosaliba8320
    @emiliosaliba8320 5 месяцев назад +6

    Best IT proffessor i ever had, amazing explanations , dinamic, thanx a lot from a poor southamerican

  • @FarizDarari
    @FarizDarari 9 месяцев назад +102

    It's mindblowing how a course video with such content quality is free. Thanks, huge thanks, CS50!

    • @Zachattack0_0
      @Zachattack0_0 9 месяцев назад +3

      Well, remember, to get a certificate costs about $200. So the course is free to access, but they are certainly making their money back with the number of certifications they give out!

    • @AA-cy9ib
      @AA-cy9ib 9 месяцев назад +5

      @@Zachattack0_0 Not true! They also give free certificates which are almost as valuable as paid ones.

    • @Zachattack0_0
      @Zachattack0_0 9 месяцев назад

      ​@@AA-cy9ib Where? AFAIK you have to pay for an official Harvard CS50 certificate.

    • @ihavermsthattypeofbrain8377
      @ihavermsthattypeofbrain8377 6 месяцев назад

      ​@@Zachattack0_0not really. I think when you go to Harvard edu it's available. It actually have same value as the $200 one

    • @padhlekaamaayega
      @padhlekaamaayega 5 месяцев назад +1

      @@Zachattack0_0 nope

  • @angelofinassu4867
    @angelofinassu4867 9 месяцев назад +8

    Finally python friends, I discovered CS wold through python years ago, but now with a university, it's very rewarding to go back to studying once again

  • @AskforQAli
    @AskforQAli 11 месяцев назад +62

    Happy New year to you all!! May 2024 be the best year for your personal growth

  • @taha7shaikh
    @taha7shaikh 4 месяца назад

    Once again, What a lecture! Forever grateful to the cs50 team for putting this course up for free. We love it.

  • @lebronuy2223
    @lebronuy2223 4 месяца назад +43

    They just rickrolled an entire lecture room 😂

    • @JorysMAHAMBA
      @JorysMAHAMBA 2 месяца назад +1

      and all of us too 😂

  • @brooksgunn5235
    @brooksgunn5235 10 месяцев назад +34

    Ah, the endings are always funny and uplifting!

  • @prjerry7777
    @prjerry7777 8 месяцев назад +4

    He is an excellent teacher.

  • @hhhhh00000
    @hhhhh00000 10 месяцев назад +23

    Wish i had just one teacher like David Malan or Brian Yu in my entire education journey . :-)

  • @harshgawali5154
    @harshgawali5154 10 месяцев назад +147

    The ending was damn! 😂
    well done CS50

  • @hedgehog_hey
    @hedgehog_hey 7 месяцев назад +2

    TKS U ! CS50 , and the professor Malan Miller!🥰

  • @GenZ_01_
    @GenZ_01_ 3 месяца назад

    Well done, I appreciate your efforts cs50 team . Thank you so much!

  • @chris-w5r6i
    @chris-w5r6i 7 месяцев назад +1

    What an amazing lecture and it is so brilliant to teach C first and then move to Python. After all that C, Python will be gravy train!

  • @pranshuatrey
    @pranshuatrey 5 месяцев назад +6

    What a perfect ending

  • @aopen130
    @aopen130 8 месяцев назад +8

    can't wait for Javascript lecture so it will break everything we learned here.

  • @ChickpeaMilkshake
    @ChickpeaMilkshake 3 месяца назад +1

    Broken my collarbone last week, but watching this keeps my mind off the pain.

    • @RameezRassel
      @RameezRassel 2 месяца назад +1

      the bots are getting crazy these days

    • @ChickpeaMilkshake
      @ChickpeaMilkshake 23 дня назад

      @@RameezRassel lol I wish it weren't true

  • @aftertwentea
    @aftertwentea 2 месяца назад

    Can't get enough of this intro.

  • @Ubiselfs
    @Ubiselfs 8 месяцев назад +4

    Man I love this guy

  • @nathaishik
    @nathaishik Месяц назад

    1:56:45 For those who are using Python 3.12 (can't say about the above versions just now), you can use double quotes inside as well (tho I would personally avoid it to reduce confusion and maintain backward compatibility)

  • @fvilpaz
    @fvilpaz 2 месяца назад

    this lecture, one of my favorites

  • @programme371
    @programme371 6 дней назад

    Are you for real professor???
    You are scaring out new programmers!!!
    Dont throw buckets at them. Let them grasp the knowledge.
    Btw.. huge respect to you sir.

  • @AmitojSingh_2402
    @AmitojSingh_2402 3 месяца назад +3

    I did not expect to get rickrolled by David J Malan in a CS50 lecure from Harvard 😭😭😭🙏🏻

  • @UNISTUDY-p9p
    @UNISTUDY-p9p 6 месяцев назад +1

    From EGYPT THIS IS GREAT❤

  • @DeshBhakt588
    @DeshBhakt588 9 месяцев назад +5

    Super energy 😊

  • @xiaoyangshawnhuang1251
    @xiaoyangshawnhuang1251 9 месяцев назад +2

    Just amazing lecture, love it, well done!

  • @monitorstolenfromikea
    @monitorstolenfromikea 4 месяца назад +18

    Lowkey gonna miss C 😢

  • @freelance-writer
    @freelance-writer 2 месяца назад +1

    "Phew! That was a lot."
    - David, before every break. 😆

  • @mickytananu5908
    @mickytananu5908 4 месяца назад +8

    We're getting rickrolled 2nd time with this one 🗣🗣🗣🗣🔥🔥🔥🔥🔥🔥🔥🔥

    • @codereboot9765
      @codereboot9765 2 месяца назад +1

      ?? Second time?

    • @mickytananu5908
      @mickytananu5908 2 месяца назад

      @@codereboot9765 There was a file that if you open in hex editor or smth you will see a link that send you to rick. I forgot to detail

    • @GosuNoKami
      @GosuNoKami 2 месяца назад

      @@codereboot9765some of us switched from another video to this updated playlist

    • @NookStudios
      @NookStudios 2 месяца назад

      @@codereboot9765probably from the lecture about html, Js, css.

  • @altaygallagher
    @altaygallagher 3 месяца назад

    this man is a legend

  • @公主肥肥
    @公主肥肥 8 месяцев назад +1

    lovely class, extraordinary

  • @sosummer217
    @sosummer217 3 месяца назад

    Fabulous professor, thanks!

  • @symbolminded5167
    @symbolminded5167 5 месяцев назад +2

    Keep grinding boys

  • @MudasirChanna-m3d
    @MudasirChanna-m3d 10 месяцев назад +5

    oh wow!! one of the best python video to learn

  • @zahidsayil9066
    @zahidsayil9066 10 месяцев назад +9

    love the energy

  • @Dragon4526
    @Dragon4526 11 месяцев назад +8

    Another year, Another CS50

  • @seiitkhanotegali7734
    @seiitkhanotegali7734 4 месяца назад +4

    YO CS50 we actually don't need to use sys to run exit.
    instead of sys.exit(1)
    we can just write exit(1) without the sys. 2:03:00

    • @sharanya005
      @sharanya005 3 месяца назад +2

      Since we are importing the complete library we need to type sys.exit()

    • @KiraIsGod
      @KiraIsGod 3 дня назад +1

      @@sharanya005 no need to import the library to use exit()

  • @RealMoaaz
    @RealMoaaz 3 месяца назад +1

    No way i got rick rolled at the end , amazing lecture , thank you cs50 :)

  • @sefonefinpsefnpefn4191
    @sefonefinpsefnpefn4191 9 месяцев назад +5

    finally python 🎉❤

  • @ryokudoom
    @ryokudoom 5 месяцев назад +4

    Can't believe i got rickrolled when rolling into my coding class

  • @certified.bibliophile
    @certified.bibliophile 2 месяца назад +1

    This has to be one of the top rickrolls ever😂

  • @Mustafa_Tahaha
    @Mustafa_Tahaha 11 месяцев назад +28

    Struggling through C to reach the holy grail that is Python!

    • @radman999
      @radman999 10 месяцев назад +5

      Would be better off sticking with C and C++ instead of a bloatware script language that anyone's mom can do

    • @MidnightV6
      @MidnightV6 10 месяцев назад +17

      @@radman999how many years have you been coding?

    • @Rayer24
      @Rayer24 10 месяцев назад

      @@radman999

    • @asadelh.28
      @asadelh.28 10 месяцев назад +1

      ​@@radman999bloatware script language thats one of the most popular and most used languages in the world, way more than C and C++ and that basically has a monopoly over AI. Youre one of those smooth brains who thinks theyre smart because somehow using verbose languages compensates for your inherent lack of programming skill

    • @tequila_baby
      @tequila_baby 10 месяцев назад +3

      Monty PYTHON

  • @SyariefAzman
    @SyariefAzman 16 дней назад

    im so getting used to the for loop and writing datatype . this is so new to me 😅

  • @220SouthlandAve
    @220SouthlandAve 2 месяца назад

    You made it past week five ‐ give yourself a pat on the back (maybe two)!!!

  • @itslonewolf742
    @itslonewolf742 2 месяца назад

    Java mentioned. Let's go!!

  • @jiffy5210
    @jiffy5210 5 месяцев назад +1

    the ending was great !!

  • @zikeng5444
    @zikeng5444 9 месяцев назад +31

    There's no goddamn way we got rickrolled by harvard university

    • @jae_pmin
      @jae_pmin Месяц назад +1

      we sure did

  • @hgamerz1238
    @hgamerz1238 4 месяца назад +1

    I knew it at the last I was having a feeling
    great ending

  • @legocis
    @legocis 9 месяцев назад +3

    Дякую! 🙂

  • @Centipede2577
    @Centipede2577 2 месяца назад +2

    Imagine getting rickrolled by a professor + in 2024 + A course + by a qr code.

  • @javanatto
    @javanatto 10 месяцев назад +11

    Oh, my! We've got rickrolled...again. what a perfect ending for a lecture, that's the perfect description XD

  • @100drips
    @100drips 4 месяца назад +1

    all that memory management just began to make fun 😅

  • @wonkanese
    @wonkanese 10 месяцев назад +7

    I can feel David Malan's energy

  • @ЪыъЪуъ-ф2ж
    @ЪыъЪуъ-ф2ж 4 месяца назад +1

    I only started to appreciate python after I started learning C

  • @hasirash6786
    @hasirash6786 9 месяцев назад +2

    Ending was so funny lol

  • @willperry1147
    @willperry1147 6 месяцев назад

    Blessed thank you

  • @ruizasri
    @ruizasri 5 месяцев назад +1

    Can't believe I got rickrolled in 2024 😆touche CS50

  • @fayzullohkarimov48
    @fayzullohkarimov48 5 месяцев назад +5

    Like if you never skip intro mucis

  • @zsunnder2355
    @zsunnder2355 5 месяцев назад +1

    Best Ending🤣🤣

  • @harshpareta-o6o
    @harshpareta-o6o Месяц назад

    Thanks

  • @tiagoantonio2343
    @tiagoantonio2343 5 месяцев назад

    I LOVE PYTHON

  • @boks02_
    @boks02_ 8 месяцев назад +2

    malloc(); is GONE 🗿free(); is GONE🗿*pointers are GONE🗿

  • @spodi4real
    @spodi4real 10 месяцев назад +1

    how come i did not know about this amazing thing called cs50 I regret every second in my life i didn't know about this!!

  • @kitgary
    @kitgary 11 месяцев назад +3

    Can we have a CS50 lesson teaching how to crack the programming interview?

  • @algorhythms11
    @algorhythms11 4 месяца назад +2

    No way he rickrolled all the students

  • @AnasKhan-pg5dc
    @AnasKhan-pg5dc 3 месяца назад +1

    wow, he just rickrolled everyone🤣🤣🤣

  • @Reeta-i9z
    @Reeta-i9z Месяц назад

    David sir, what did you code in your bridge.bmp program ?

  • @GoldGlory7745
    @GoldGlory7745 2 месяца назад

    I have a question to ask you. I am still learning as a beginner. So, I would like to ask you a question, in the real world require have to use VS code once they land a job as role as such a software engineer, computer programmer Data Science, or AI engineer? Let me know. Thank you!

  • @arik2492
    @arik2492 3 месяца назад

    We really did get a David J Malan rickroll before Gta 6

  • @bimbom9712
    @bimbom9712 3 месяца назад

    saw that ending from a mile away lmfaooooooooo

  • @Serhii007
    @Serhii007 11 месяцев назад +7

    Дякую!

  • @eleos11
    @eleos11 7 месяцев назад +1

    When I watch David's lectures I like to follow copying the code. However, here I wonder where are all those files like speller.py reside, so that I could use them. Is there a repository of some sort? Any ideas?

  • @KamalVerse
    @KamalVerse 22 дня назад

    The rickrolls never gonna give up on us😂

  • @이이이-g4f2y
    @이이이-g4f2y 5 месяцев назад

    The dictionary part is a littlebit tough haha.. there are crazy syntax like what he said

  • @maianhvk
    @maianhvk 18 дней назад

    Whew, this is a breeze compared to the previous 2 weeks.

  • @Aditya-pk8qv
    @Aditya-pk8qv 2 месяца назад

    01:05:00

  • @kenyhu4759
    @kenyhu4759 8 месяцев назад

    Good day

  • @randomenia
    @randomenia 9 месяцев назад +1

    I don't speak english I'm watching whit Subtitule I have 16 years old You're The Best sorry for error

  • @garrickmahochmannph
    @garrickmahochmannph 7 месяцев назад

    Greatest rickroll 2024

  • @Jonathanmillspatrick
    @Jonathanmillspatrick 6 месяцев назад

    Is there a rationale for the extra spacing, two blank lines, between code?

    • @brandy9725
      @brandy9725 6 месяцев назад +1

      David explains at 1:27:08 that it's a convention to help make functions stand out

  • @姚景曦
    @姚景曦 4 месяца назад

    Is there any difference between the cs50x_WEEK6 python course and the cs50p course???

    • @divya_25_06
      @divya_25_06 2 месяца назад +1

      Cs50 p is specifically for python ❤

  • @Zangetsu-gaTensho
    @Zangetsu-gaTensho 4 месяца назад +1

    Damn this one has lost me
    I need to look up the weekly problem sets, cuz this feels like I am missing alot 😅

  • @MrCustomabstract
    @MrCustomabstract 4 месяца назад

    one does not simply learn cs without the proper rick roll hazing

  • @airkh.
    @airkh. 8 месяцев назад

    the rickroll at the end lmaoo

  • @fakrulotaku5655
    @fakrulotaku5655 5 месяцев назад

    2:03:52 is kinda hilarious 😂

  • @FCAlex07
    @FCAlex07 4 месяца назад +1

    We got rickrolled by Harvard University before GTA 6

  • @hsglator7135
    @hsglator7135 4 месяца назад

    Hey guys, while watching this lecture, I just realized that there are problem sets that need to be done. And The problem is that I don't have access to a computer or laptop to complete them. I was wondering if anyone knows a way to do them using a mobile ? If you know, please guide me.

    • @Zangetsu-gaTensho
      @Zangetsu-gaTensho 4 месяца назад

      There was a compiler I used on android
      You can search up c compiler
      My problem is... Where are those problem sets? Can you help me

    • @karateuma
      @karateuma 4 месяца назад

      ​@@Zangetsu-gaTenshoneed to access from website where the whole course is available

  • @georgimmitev
    @georgimmitev 5 месяцев назад

    1:15:24

  • @prachurjyapratimgoswami4970
    @prachurjyapratimgoswami4970 4 месяца назад +1

    did i seriously get rickrolled in big 2k24

  • @jesuscarrillo7411
    @jesuscarrillo7411 9 месяцев назад +1

    Great

  • @ShahbazG
    @ShahbazG 6 месяцев назад +1

    problem set? 🤔

  • @P4P4Lui
    @P4P4Lui 3 месяца назад

    Seething with rage rn

  • @grindinguy
    @grindinguy 9 месяцев назад

    i knew it but im rickrolled too :)

  • @fakrulotaku5655
    @fakrulotaku5655 5 месяцев назад

    The ending 😂😂

  • @bx7gamer
    @bx7gamer 8 месяцев назад +2

    Can someone please list all the modules (pip) installed during the course! ,thanks in advance

    • @aopen130
      @aopen130 8 месяцев назад

      `pip list` in the command prompt. if it doesn't work, make sure the virtual environment is in your PATH
      you can learn more about syntax for pip list command with `python -m pip list`