CS50 Video Player
    • 🧁

    • 🍮

    • 🥭

    • 🍿
    • 0:00:24DAVID MALAN: Hello, world.
    • 0:00:25My name is David Malan, and this is CS50's Introduction
    • 0:00:28to Programming with Python.
    • 0:00:29Whereas CS50 itself is an introduction to the intellectual enterprises
    • 0:00:33of computer science and the art of programming,
    • 0:00:35this course is specifically focused on programming in Python itself.
    • 0:00:40At the beginning of the course, we'll be focused
    • 0:00:42on a topic in programming known as functions and variables, mechanisms
    • 0:00:45via which you can write code that solves smaller problems,
    • 0:00:48but you can compose those smaller solutions into solutions
    • 0:00:51to larger problems still.
    • 0:00:52We'll then transition to a look at conditionals,
    • 0:00:54a way in code of expressing yourself logically, to maybe do something
    • 0:00:59if some question has an answer of true, or not
    • 0:01:02do something if the answer is false.
    • 0:01:04We'll transition thereafter to introducing you
    • 0:01:06to loops, the ability, in code, to do something again, and again,
    • 0:01:09and again some number of times.
    • 0:01:11We'll then transition to something a little more technical,
    • 0:01:14known as exceptions.
    • 0:01:15Unfortunately, a lot can go wrong when you're writing code, some of it
    • 0:01:18your fault, some of it perhaps someone else's fault.
    • 0:01:20But you can write code defensively, so to speak, and actually
    • 0:01:23catch those kinds of exceptions, those errors,
    • 0:01:26and handle them properly so that the users you're writing code for
    • 0:01:29don't actually see the same.
    • 0:01:30Thereafter, we'll take a look at libraries, third-party code,
    • 0:01:34written by other people, often, or perhaps yourself in the past,
    • 0:01:37that you can use and reuse in your own projects
    • 0:01:40so as to avoid reinventing the wheel again and again.
    • 0:01:42We'll look thereafter at something called unit tests.
    • 0:01:45It turns out, you'll actually write code to test your own code.
    • 0:01:49But you won't have to write tests for your tests.
    • 0:01:51Indeed, this is a best practice in industry, writing tests for your code
    • 0:01:55so that one, you can be sure that your code today is, hopefully,
    • 0:01:58if your tests are correct, correct itself.
    • 0:02:00But moreover, if you or someone else modifies your code tomorrow, or down
    • 0:02:04the line, you can rerun those same tests to ensure
    • 0:02:07that those new changes have not broken anything about your own code.
    • 0:02:10We'll then take a look at something called
    • 0:02:12File I/O, I/O for input and output, the ability
    • 0:02:15to not just store information inside of a computer's memory,
    • 0:02:19but rather save it persistently to disk, so to speak, to files and folders.
    • 0:02:23We'll then take a look at another technique, known
    • 0:02:25as regular expressions, whereby, in Python, you can define patterns
    • 0:02:29and you can validate data to make sure the human typed something in as you
    • 0:02:33expect.
    • 0:02:33You can use regular expressions to extract data, perhaps
    • 0:02:36from some data set you're trying to analyze.
    • 0:02:38We'll then take a look, ultimately, at object-oriented programming,
    • 0:02:42a paradigm, a way of writing code, whereby you can represent, in code,
    • 0:02:46real-world entities.
    • 0:02:47And this is in addition to other paradigms of programming that we'll
    • 0:02:50also explore, among them procedural programming,
    • 0:02:53where you write lots of those functions, procedures
    • 0:02:55really, top to bottom, to solve problems step by step,
    • 0:02:58and even something known as functional programming, as well.
    • 0:03:01And then at the very end of the course will we
    • 0:03:02equip you with all the more tools for your toolkit.
    • 0:03:06and additional building blocks, additional vocabulary
    • 0:03:09via which, after this same course, you can go off on your own
    • 0:03:12and either take other courses or solve projects of your own,
    • 0:03:15using all of these mechanisms.
    • 0:03:17Now this course itself assumes no prior programming background.
    • 0:03:20So you don't have to have written a single line of code in Python,
    • 0:03:23or any language, yet.
    • 0:03:25But this is also a course that you can take before, during, or even after CS50
    • 0:03:29itself, if you'd like to get all the more versed with Python.
    • 0:03:33Each week, via the courses lectures, will we introduce you
    • 0:03:35to any number of concepts that we'll then
    • 0:03:37drill down more deeply into in the form of problem sets each week.
    • 0:03:41That is, programming projects that will enable
    • 0:03:43you to apply some of those lessons learned to problems of your very own.
    • 0:03:47And by the end of the course, you'll have
    • 0:03:49solved so many problems that, ideally, are representative
    • 0:03:53of problems you'll eventually encounter in the real world,
    • 0:03:55whether you aspire to solve code in the technical world
    • 0:03:58or perhaps in the arts, the humanities, the social sciences,
    • 0:04:01the natural sciences, or beyond.
    • 0:04:03You'll have, ultimately, the vocabulary and the technical skills
    • 0:04:06via which to approach the same.
    • 0:04:08This, then, is CS50.
    • 0:04:10And this is CS50's Introduction to Programming with Python.
  • CS50.ai
Shortcuts
Before using a shortcut, click at least once on the video itself (to give it "focus") after closing this window.
Play/Pause spacebar or k
Rewind 10 seconds left arrow or j
Fast forward 10 seconds right arrow or l
Previous frame (while paused) ,
Next frame (while paused) .
Decrease playback rate <
Increase playback rate >
Toggle captions on/off c
Toggle mute m
Toggle full screen f or double-click video