CS50P - Lecture 2 - Loops

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

TABLE OF CONTENTS

00:00:00 - Introduction
00:00:24 - Loops
00:03:24 - while
00:16:21 - for
00:27:00 - Validating Input
00:34:59 - Iteration with Lists
00:40:36 - len
00:45:47 - Dictionaries
00:57:02 - Lists of Dictionaries
01:05:02 - Nested Loops
01:20:17 - Conclusion

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
Рекомендации по теме
Комментарии
Автор

Its hard to explain the level of joy i got from hearing a harvard professor say the word "meow" this many times in a row haha... but seriously unmatched energy amazing teacher

lucaslarsen
Автор

This is the best designed course in Python. David knows how to set the stage for solving problems incrementally. Hats down professor!

philippe
Автор

Wow, what a top-notch teacher! Wishing him eternal health and a lifetime supply of coffee! He’s transformed more lives than Python has modules. Big love from Poland! 🇵🇱

The_Dacian
Автор

It's quite astonishing JUST how much David is a better teacher than every other human being.

faanross
Автор

Best Python's course ever! Great Professor.

alessandrochiri
Автор

It's amazing to have access to these lectures for free on YouTube. David is an excellent teacher and I always feel engaged and curious... unlike other lectures I've gone to when I was in uni. Loving it! Greetings from Germany.

Moogerton
Автор

Good God, one lecture after another. The good thing is that it doesn't tire.
Thank you David, you are the best.

cleidysbrooks
Автор

I saw lots of tutorials for python but no one matches the level of your teaching. Sir The way you explain core concepts its extremely appreciable off FROM INDIA🙏🙏

meghajadiya
Автор

I admire David's energy, it helps me keep my focus on topic for like 1/5 hour

saranourimottaghi
Автор

44:20 is the best way ive heard a for loop explained

petephelp
Автор

I, like many others, paid a lot of money to attend college for 4 years. I have an engineering degree, but not once during those 4 years was I exposed to teaching on this level. I often struggled to stay engaged with my studies but I’ve done two courses taught by David and not once did I feel burnt out. So much respect for David and his team at Harvard for making these courses available to us for free.

ajterry
Автор

Very Energetic as our friend mentioned !
thank you very match for making such a professional field and envirnment of study i think that i am actually sitting there and learning.

مرکزآموزشدخترانافغانستانمکتبخا
Автор

Huge shout out to whoever asked the question at 44:00. I had that exact same question and had trouble finding it using the internet.

lasagnahog
Автор

one of the best source....please give problem solving course....

jupiter
Автор

i just admire the energy of this teacher .

edwinyiaile
Автор

1:16:52
here's my alternative solution for the # square thing!
def main() :
x = int(input("how big of a square do u want? Give me a number. "))
print_square(x)

def print_square(y):
for _ in range(y):
print("# "* y)
main()

oh okay he did it now haha. But by the way if you really want it to look like a real square hit the space bar after the #


thank you for the lesson David <3

allbusiness
Автор

Having written a complicated roguelike game in python using curses without any formal training, just winging it, I suddenly grasp what I was doing much clearer. All those months of playing with code brings up memories of each function and class i wrote and makes it clear. Thanks for these lectures!

pietpadda
Автор

Just have to say thank you, David! You made CS so relatable, interesting, and easy to understand.

yqhanliving
Автор

I saw a lot of people were confused about naming the variable in the for loop. It also confused me, so what I did I created my own variable instead of using "student" like David. I chose to go with "wizard" as my made up variable and it helped me visualize the difference between the variable (student) and the dictionary (dict) which was named students. This may be trivial but it helped me understand it a bit more. To help further, I actually have my visual studio open and going along. I think this helps tremendously. Goodluck!

franciscor
Автор

I love the flow charts .. Very helpful. Thanks

caseyspaulding