CS50P - Introduction

CS50P - Introduction

Introduction

In this section, David Malan introduces the course and explains what will be covered.

Course Overview

  • CS50's Introduction to Programming with Python is a course focused on programming in Python.
  • The course covers topics such as functions and variables, conditionals, loops, exceptions, libraries, unit tests, File I/O, regular expressions and object-oriented programming.
  • The course assumes no prior programming background.

Course Structure

  • Each week there will be lectures introducing new concepts followed by problem sets that allow students to apply those lessons learned.
  • By the end of the course students will have solved many problems representative of real-world problems they may encounter in various fields.

Functions and Variables

This section covers functions and variables which are mechanisms via which you can write code that solves smaller problems but can compose those smaller solutions into solutions to larger problems still.

Topics Covered

  • Functions
  • Variables
  • Composing smaller solutions into larger ones

Conditionals

This section covers conditionals which are a way in code of expressing yourself logically to maybe do something if some question has an answer of true or not do something if the answer is false.

Topics Covered

  • Expressing logic through code
  • If statements
  • Boolean values (True/False)

Loops

This section covers loops which give you the ability in code to do something again and again some number of times.

Topics Covered

  • While loops
  • For loops
  • Range function

Exceptions

This section covers exceptions which are errors that can occur when writing code. You can write code defensively so to speak and actually catch those kinds of exceptions, those errors, and handle them properly so that the users you're writing code for don't actually see the same.

Topics Covered

  • Errors in code
  • Defensive coding
  • Exception handling

Libraries

This section covers libraries which are third-party code written by other people or perhaps yourself in the past that you can use and reuse in your own projects so as to avoid reinventing the wheel again and again.

Topics Covered

  • Third-party code
  • Reusing code
  • Avoiding redundancy

Unit Tests

This section covers unit tests. You'll actually write code to test your own code. Writing tests for your code is a best practice in industry so that one, you can be sure that your code today is correct itself. But moreover, if you or someone else modifies your code tomorrow or down the line, you can rerun those same tests to ensure that those new changes have not broken anything about your own code.

Topics Covered

  • Writing tests for your own code
  • Best practices in industry
  • Ensuring correctness of future modifications

File I/O

This section covers File I/O (input/output), which is the ability to not just store information inside of a computer's memory but rather save it persistently to disk, so to speak, to files and folders.

Topics Covered

  • Saving data persistently
  • Reading from files
  • Writing to files

Regular Expressions

This section covers regular expressions whereby in Python you can define patterns and validate data to make sure the human typed something in as expected. You can use regular expressions to extract data perhaps from some dataset you're trying to analyze.

Topics Covered

  • Defining patterns
  • Validating data
  • Extracting data

Object-Oriented Programming

This section covers object-oriented programming, a paradigm, a way of writing code whereby you can represent in code real-world entities.

Topics Covered

  • Representing real-world entities in code
  • Other paradigms of programming (procedural and functional)
  • Additional building blocks and vocabulary
Video description

This is CS50P, CS50's Introduction to Programming with Python. Enroll for free at https://cs50.edx.org/python. Slides, source code, and more at https://cs50.harvard.edu/python. Playlist at https://www.youtube.com/playlist?list=PLhQjrBD2T3817j24-GogXmWqO5Q5vYy0V. 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 http://www.youtube.com/subscription_center?add_user=cs50tv HOW TO TAKE CS50 edX: https://cs50.edx.org/ Harvard Extension School: https://cs50.harvard.edu/extension Harvard Summer School: https://cs50.harvard.edu/summer OpenCourseWare: https://cs50.harvard.edu/x HOW TO JOIN CS50 COMMUNITIES Discord: https://discord.gg/cs50 Ed: https://cs50.harvard.edu/x/ed Facebook Group: https://www.facebook.com/groups/cs50/ Faceboook Page: https://www.facebook.com/cs50/ GitHub: https://github.com/cs50 Gitter: https://gitter.im/cs50/x Instagram: https://instagram.com/cs50 LinkedIn Group: https://www.linkedin.com/groups/7437240/ LinkedIn Page: https://www.linkedin.com/school/cs50/ Medium: https://cs50.medium.com/ Quora: https://www.quora.com/topic/CS50 Reddit: https://www.reddit.com/r/cs50/ Slack: https://cs50.edx.org/slack Snapchat: https://www.snapchat.com/add/cs50 SoundCloud: https://soundcloud.com/cs50 Stack Exchange: https://cs50.stackexchange.com/ TikTok: https://www.tiktok.com/@cs50 Twitter: https://twitter.com/cs50 YouTube: http://www.youtube.com/cs50 HOW TO FOLLOW DAVID J. MALAN Facebook: https://www.facebook.com/dmalan GitHub: https://github.com/dmalan Instagram: https://www.instagram.com/davidjmalan/ LinkedIn: https://www.linkedin.com/in/malan/ Quora: https://www.quora.com/profile/David-J-Malan TikTok: https://www.tiktok.com/@davidjmalan Twitter: https://twitter.com/davidjmalan *** CS50 SHOP https://cs50.harvardshop.com/ *** LICENSE CC BY-NC-SA 4.0 Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License https://creativecommons.org/licenses/by-nc-sa/4.0/ David J. Malan https://cs.harvard.edu/malan malan@harvard.edu