CS50P - Lecture 4 - Libraries

preview_player
Показать описание

TABLE OF CONTENTS

00:00:00 - Introduction
00:00:24 - Libraries
00:00:54 - Modules
00:03:13 - import
00:07:35 - from
00:11:23 - randint, shuffle
00:17:01 - statistics
00:19:13 - Command-line Arguments, sys
00:40:55 - Slices
00:44:41 - Packages, PyPI, pip
00:47:10 - cowsay
00:53:26 - APIs, requests, JSON
01:10:06 - Custom Libraries

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

HOW TO TAKE CS50

HOW TO JOIN CS50 COMMUNITIES

HOW TO FOLLOW DAVID J. MALAN

***

CS50 SHOP

***

LICENSE

CC BY-NC-SA 4.0
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License

David J. Malan
Рекомендации по теме
Комментарии
Автор

1:14:02
if you add a line
print(__name__)
you will print the current module name, which will be "__main__".
That's why you use:
if __name__ == "__main__"
which means:
"if the module name where I am right now is "__main__", then and only then run the code below." 
The code below will usually call your main function, which, in turn, will call any other function you put in it.
All other modules you import will be not "__main__" when the main module is your current file. Therefore, if they also have this statement (if __name__ == "__main__"), their functions will not run automatically when you import them, because this statement will be false.

Please note that YouTube is removing some of the underscores in my comment.

allanatal
Автор

The puppets talking to each other before class starts 😂😂😂

MisterK-YT
Автор

My God, his teaching skills are insane. His communication skill, flow and organization of thoughts. Damn, could I ever get there...

speedsystem
Автор

Just want to say how much I am enjoying this course so far. Thanks to David and the CS50P team

go_away_plz
Автор

7:37 prog1 10:34 prog2 13:15 prog3 15:23 prog4 19:30 prog5 24:50 prog6 28:38 prog7 30:49 prog8 42:43 prog9 1:02:09 prog10 1:05:49 prog11 1:08:04 prog12 1:12:44 prog13 1:13:56 prog14 1:15:22 prog15

mahipalmahato
Автор

for the past couple of weeks, I was trying to remember the band Weezer and their songs, but I just couldn't. who knew I would find them again in a CS50 lecture. crazy how life works

lmaoded
Автор

Great Work Sir. CS50 has done a great social work for the people eager to learn coding.Thanks again

mashudbahi
Автор

I'm just grateful for this incredible amazing course from this legend man and the CS50 team. I've never wished a lecture in a course to not end but I do when I watch your courses. thank you!

alii
Автор

can't wait for the exercise to be 100x harder than this lecture.

LAAL_O
Автор

His Communication & Teaching Skills Are Insane! I Believe I'll Get There One Day.

AstralNomadd
Автор

one of the best lessons between cs50x and python

Bruno-rmer
Автор

This is a priceless opportunity to have access to lessons like this. Thank you so much.

nimbabul
Автор

Thank you David, I am learning Python from the ground up and these lectures have been SO amazing.

geetee
Автор

API's section I love the most
God Bless you David Malan

Innovative_Mind
Автор

Thank you for the fantastic session, David! You're the best!

RomiVa...
Автор

out of all the possible lectures i happen to end up with this one somehow, well it was the pressure of ''tutorial hell'' phase that landed me here and now i only feel confortable to watch this one with puppets and learn. what a weird world we live in.

I am so happy to reach so far. i cant balieve i came this far, i knew nothing from looking at any code and now i know so much from 3 weeks back to now. I feel like the last half of this cource gonna be very hard. hope now. so far its been going smooth, well if i look back not that smooth, i had my ups and downs, crying and forcing myself to continue. I never enjoyed studying like this before in my life.

GrimmReaper
Автор

1:06:13 knowing how to manipulate/read data from these structures are so important

sayori
Автор

Great presenter! Very well organized! Thanks for publishing this!

derickmcwilliams
Автор

As usual good lesson and extremely difficult.

percys
Автор

In 33:23, David says that it is better to keep all of your error handling separate from the code you really care about. But I think that checking first if there is an error could execute more lines of code unnecessarily. You expect that most of the time the code will not have an error, so it might be better to check if we can proceed without errors first, and then verify which error we have.

CronosAI