Harvard CS50’s Introduction to Programming with Python – Full University Course

preview_player
Показать описание
Learn Python programming from Harvard University. It dives more deeply into the design and implementation of web apps with Python, JavaScript, and SQL using frameworks like Django, React, and Bootstrap. Topics include database design, scalability, security, and user experience. You will learn how to write and use APIs, create interactive UIs, and leverage cloud services like GitHub and Heroku.

This course will teach you how to read and write code as well as how to test and “debug” it. It is 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 (the original CS50 course) 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!

✏️ Dr. David J. Malan teaches this course.

⭐️ Course Contents ⭐️
(00:00:00) Introduction
(00:04:48) Lecture 0 - Functions, Variables
(01:50:24) Lecture 1 - Conditionals
(02:46:23) Lecture 2 - Loops
(04:07:10) Lecture 3 - Exceptions
(04:51:45) Lecture 4 - Libraries
(06:09:15) Lecture 5 - Unit Tests
(07:00:22) Lecture 6 - File I/O
(08:32:32) Lecture 7 - Regular Expressions
(10:37:35) Lecture 8 - Object-Oriented Programming
(13:28:47) Lecture 9 - Et Cetera

HOW TO JOIN CS50 COMMUNITIES

HOW TO FOLLOW DAVID J. MALAN

LICENSE

CC BY-NC-SA 4.0
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License
Рекомендации по теме
Комментарии
Автор

00:00 Learn Python programming from scratch with Harvard's Introduction to Programming course
06:18 Learned how to write and run a simple Python program using the command line interface.
16:45 Improving the program with user input and variables
21:38 Introduction to assignment operator and comments in Python
31:46 Pass multiple arguments to a function using commas
00:36 Learn to read documentation to understand function parameters and arguments.
47:44 Python strings have built-in functionality to manipulate user input.
52:48 Strip and title case a user's input in a single line of code.
1:03:07 Python supports interactive mode and basic arithmetic operations.
1:08:09 Create an interactive calculator in Python.
1:18:49 Support floating point values and round to nearest integer
1:24:01 Python can automatically format numbers with commas for readability.
1:34:16 Creating a custom function with parameters and default values in Python.
1:39:31 Organize functions in any order by calling main function at the end.
1:49:57 Introduction to conditionals in Python
1:55:25 Code can be correct but poorly designed, leading to repetition and inefficiency.
01:28 Simplification of code using 'else' statements
2:11:51 Simplify code by asking fewer questions
2:22:11 Introducing the modulo operator for modular arithmetic
2:27:29 Creating a function to determine if a number is even or odd
2:38:25 Implement a program using if-else construct to output the house of a Harry Potter character based on user input.
2:43:09 Introduction to Loops in Python
2:53:56 Count from 1 to 3 and print 'meow' each time
2:59:18 Introduction to for loops and lists in Python
3:10:18 Using escape sequences to concatenate strings in Python
3:15:38 Implement a meow function that prints 'meow' n times.
3:25:54 Iterating over lists using numbers in Python
3:31:22 Python dictionaries allow you to associate one value with another.
3:42:04 Iterating over dictionaries in Python
3:47:30 Introduction to dictionaries in Python
3:57:50 Implementing a reusable function to print a square using loops in Python
4:03:15 Exceptions in Python refer to problems in your code.
4:13:55 Handle errors in Python using try and except
4:18:58 Handle specific errors, not all exceptions
4:29:43 Improving user input with loops in Python
4:35:09 Abstracting user input into a function
4:45:05 Python uses indentation to associate lines of code with each other.
4:50:31 Python supports modules to encourage reusability of code.
5:01:12 Python's random module has useful functions like randint and shuffle.
5:06:04 Python has modules for generating random data and performing statistical analysis.
16:25 Handling exceptions and checking for user input in Python
5:21:33 Refactor code to separate error handling from main logic
5:32:18 Python packages provide additional functionality beyond built-in modules.
5:37:38 Python has a package manager called pip for installing third-party packages.
5:48:12 JSON is a language-agnostic format for exchanging data between computers.
5:53:30 Using Python's Json library to format data cleanly
6:04:12 Using conditional statements to prevent unwanted function calls
03:05 Testing your own code is a good practice
6:19:48 Using assert in Python can lead to errors on the screen, but try and except can catch them.
6:24:52 Pi test automates testing of code, simplifying the process.
6:35:20 Unit testing is a technique that is independent of cs50 and should be done on your own code.
00:24 Unit testing with Pi test automates testing process
6:51:11 Functions should not have side effects for better testability.
6:56:46 File I/O allows for persistent data storage
00:31 Appending to a file in Python
7:12:30 Automate file closing with 'with' keyword
7:22:30 Read and sort names from a file in Python
7:27:27 CSV files are commonly used to store multiple pieces of information that are related in the same file.
7:38:00 Read entire file to make changes in memory and write back for larger files
7:43:17 Sort a list of dictionaries by a specific key using the sorted() function and a custom key function.
7:54:33 Using Lambda functions in Python to simplify code
8:00:09 Use the CSV library in Python to read and write CSV files.
07:27 Using a dictionary reader in Python allows for flexibility in handling CSV files.
8:16:06 CSV files can be read and written using dictionaries in Python.
8:26:54 Using the pillow library, we can read and write binary image files.
8:32:16 Introduction to regular expressions in Python
8:42:43 Using the re library in Python to validate email addresses
8:47:41 Regular expressions allow for specifying patterns of characters.
8:58:15 Using raw strings and regular expressions to match email addresses
9:03:24 Regular expressions can be used to validate input and match patterns.
9:14:10 New syntax for email validation using regular expressions
9:19:34 Regular expressions can be used to represent sets of characters in a concise way.
9:30:28 Validating email addresses using regular expressions in Python
9:35:59 Validating email addresses using regular expressions
9:46:51 Standardize user input to avoid data inconsistencies
9:51:54 Improved code using regular expressions to capture user input
10:03:06 Python's walrus operator allows for assigning and asking a Boolean question in one line.
10:08:22 Extracting Twitter username using regular expressions
10:19:07 Tolerating HTTP and HTTPS in regular expressions
10:24:40 Use re.search instead of re.sub for conditional logic
10:35:54 Introduction to Object-Oriented Programming in Python
10:41:12 Writing functions as building blocks for more complex programs.
10:51:14 Immutable tuples cannot be changed, but lists can be used instead.
10:56:28 Using dictionaries for better semantics and readability
11:06:56 Creating custom data types using classes in Python
11:12:12 Classes in Python allow for standardization of attributes and methods.
11:23:09 Classes offer more features than dictionaries
11:28:26 Encapsulate validation logic inside the class
11:38:52 Classes in Python can be imported and used in other files or projects, and can have optional variables and custom error messages.
11:44:20 Adding a Patronus attribute to the Student class
11:55:17 Classes allow instance variables to be accessed and changed using dot notation, even if they do not meet validation requirements.
12:00:44 Python properties allow for more control over attributes.
00:22 Using getters and setters in Python classes for more control
12:17:02 Python does not have hard constraints for visibility of instance variables.
12:27:52 Learn about class methods in Python
12:33:17 Implemented a Sorting Hat class that assigns a house to Harry randomly.
12:44:09 Object-oriented programming is a way of encapsulating related data and functionality inside classes.
12:49:26 Moved related functionality to class method for better design
13:00:05 Object-oriented programming in Python supports inheritance.
13:05:07 Inheritance allows subclasses to inherit functionality from their parent classes.
13:15:30 Create a Vault class with an init method and a stir method to print out the contents of the vault.
13:20:33 Python allows operator overloading with special methods.
13:31:13 Using sets to find unique values in a list of dictionaries
13:36:09 Implementing a simple bank in Python with deposit and withdraw functions.
13:46:32 Implementing bank account using object-oriented programming
13:51:43 Python does not enforce constants, only conventions.
14:01:38 Adding type hints to variables and functions can help catch errors before running the code.
14:07:07 Using type hints in Python can catch errors before running the program.
14:18:00 Documenting code using conventions and tools
14:23:14 Modify meows program to take command line arguments
14:33:24 Outsource commodity tasks to focus on the interesting parts of a project
14:38:36 Python offers powerful features like automatic error messages and value unpacking.
14:48:58 Unpacking can be done with dictionaries as well
14:54:11 Python allows for variable number of arguments in functions using *args and **kwargs.
15:04:31 Python supports procedural, object-oriented, and functional programming paradigms.
15:09:41 Use map() function to apply a function to every element of a list.
15:20:20 Two approaches to filter a list of Gryffindor students in Python
15:25:34 Using dictionary comprehensions to build data structures more succinctly
15:36:04 Learn how to generate values in Python from functions.
15:40:48 Printing large number of sheep is causing memory issues
15:51:16 CS50's Python course covers a variety of programming concepts and tools.
15:56:19 Learning Python helps in problem-solving and self-teaching

abhaymaheshwari
Автор

Dear beginners, I wish you to know a few things.

1) This course-work is incredibly amazing. This can definitely take you places. There's no doubt with that.

2) It's totally okay if you feel overwhelmed in the first 10-20 minutes of the video itself. PLEASE DON'T GIVE UP - IT'S MY HUMBLE REQUEST! I shall be very honest with you - actually, what's being covered in the 10-20 minutes of this video is what we learn in 10-20 days at the normal pace. The course is just fast paced. So, please allow yourself some time. Take it very slow - one step at a time.

Once again, I won't lie - Yes, the course-work is very tough (afterall it's coming out of Harvard) - you will have to Google a lot along the way, watch many other YouTube videos along the way. But, DON'T GIVE UP!

tenamsb
Автор

im 50 years old, i'm new never code before wish me luck. 😃

blessingkhanyile
Автор

3 months into learning python this is my experience. I bought a 90% off udemy course which is my main way to learn python. I spend 1-2 hours in the morning before work to learn. Afterwards I watch this video as well as the cs50 course while working. I went from knowing absolutely nothing about coding to having 6-8 tiny apps to my name. I believe I have every skill needed to learn any module I want to learn. My main focus will be machine learning and ai. I will be an industry professional in this field in 2 years or less. If you want to learn you should do it. Expect it to finally start clicking in about 2 months. It is very much worth learning. Good luck!

loganchow
Автор

⭐ Course Contents ⭐
(00:00:00) Introduction
(00:04:48) Lecture 0 - Functions, Variables
(01:50:24) Lecture 1 - Conditionals
(02:46:23) Lecture 2 - Loops
(04:07:10) Lecture 3 - Exceptions
(04:51:45) Lecture 4 - Libraries
(06:09:15) Lecture 5 - Unit Tests
(07:00:22) Lecture 6 - File I/O
(08:32:32) Lecture 7 - Regular Expressions
(10:37:35) Lecture 8 - Object-Oriented Programming
(13:28:47) Lecture 9 - Et Cetera

krishna_
Автор

In order to have a "Coding Mindset", which is essential to flourishing in this field, you must:
1.) Understand and internalize the fact that no matter what problem, annoyance, or obstacle you face, THERE IS ALWAYS A SOLUTION. You just need to find it.
2.) Have the humility to accept that you could have made a mistake somewhere, THE COMPILER IS ALWAYS RIGHT

muhammadmalik
Автор

This teacher is a genius, I can not believe after 20 year leaving university, I still can focus his course for 2 hours! Big thanks to you, David, respect!

xgz
Автор

Just a self study index.
02:46:23 Loops
02:34:35 Conditionals - Modern syntax
02:41:46 Match cases (swift)
02:51:16 Loops - While - (chart - 02:55:33)
03:03:51 For Loop
03:30:33 A nice loops recap
03:32:56 Dictionaries
03:59:02 Functions + forLoops to print squares
04:07:10 Lecture 3 - Exceptions
04:32:47 Except in a loop
04:37:03 Playing with functions - refinement
04:51:45 - Libraries
04:55:52 Random
05:32:53 Slices
05:36:42 Packages
05:48:00 JSON
06:01:55 Making our own libraries
06:09:15 - Unit Tests
06:26:25 Pytest
07:05:59 Storing and extracting data in and from external files - Files I/O
07:38:23 Messing around lists and dictionaries - Sorting and playing with functions
08:01:38 Working with csvs
08:23:50 Images and giffs with pillow
08:32:32 Regular Expressions
09:30:37 Built-inVariables
09:53:13 Formating - Useful for clean-up data purposes
10:37:35 OOP
10:47:46 Tuples
11:02:16 Classes
11:10:29 Objects
11:42:09 __str__
11:57:13 A quick recap about what written each line does inside the class
12:00:24 @properties
12:30:12 Decorators
12:59:05 Inheritance
13:13:23 Operation overloading
13:29:36 Some otrher stuff

rjuela
Автор

this is some serious charity you guys are doing to young minds ♥️🙏

dubeyzune
Автор

i am going through a deep depression because of my actual bad job plus heartbroken af plus family problems and lonelyness. but this course gives me hope for a new carreer path and i already studied it approximately half of it, it is difficult to study for me for my problems but after one month i could sudy well half of it reviewing the topics over and over as i am new, i wish i can finish it and learn a lot and one day work in a better place and start changing my life and end depression. the teacher is great i wish i was able to ask him some of my doubts but still... thank you for doing this great work open for all. greetings to you all from Argentina.

HistoriasyLeyendasUrbana-gkgo
Автор

Got my First Job Cause of this Course it was a huge begining Thanks.

Alee
Автор

Courses like this from the world's most expensive and costly institutions for free show us the importance of YouTube.
I mean that they are making money out of YouTube through these video courses.

Kazimraz
Автор

David really is a great teacher, as someone who is somewhat new and also hates school, this man knows exactly what he is doing. He provides examples as bad, good, better, and best to really give you an idea on how a programmer should think.

Teejito
Автор

This is incredible. His teaching is, of course, the best! But what I appreciate even more is his attitude towards answering questions. He never says "That is out of scope for the course" or that "it cannot be discussed at the moment". He always provides clear answers without any judgment, making it easy for all students to understand. I can tell students feel safe asking any question without fear of seeming foolish. I have so much respect for Professor David Malan. I've never met a teacher like him in my life. Love him so much.

novagritX
Автор

He is such an insanely good instructor. For those who have not had a formal college education before, you should know that having the right professor who can articulate foundational concepts efficiently and clearly to beginner students, while also keeping it interesting, can be very hard to come by. The fact that this course and CS50x have been put up for free is awesome.
I usually roll my eyes when people just assume something is good because it has an Ivy League name slapped on it, but in this case -- because David Malan -- it is good.

timkohn
Автор

Malan is such an amazing instructor, teaching he is doing is unparalleled. I simply cannot stop watching his lectures.

janitholagama
Автор

The fact that this guy teaches programming with Python with such passion is motivating, massive thanks.

maximus
Автор

10:17 Functions
11:07 Arguments in functions
11:38 Side effect of programs
12:14 Bugs
19:21 Return values
20:17 Variables
21:35 Assignment operator (right to left)
24:48 Comments
27:06 Pseudocode
35:52 str data type
38:02 print() function
39:17 Parameters (vs arguments)

sen.sanchariii
Автор

I’m not a beginner. But I found the OOP and Unit Testing chapters incredibly useful! This is really gold. Super clear teaching style. Thank you so much for posting this on YouTube!

JeremyJanzen
Автор

The quality of this teacher and this teaching is off the scale. Utterly brilliant. Now I understand why Harvard has such a great reputation. If this course is indicative of the quality of teaching at Harvard, then students at Harvard, whether resident or online, are very fortunate indeed.

Many thanks David Malan for this superb course.

Mark-wwsb