I am not the biggest fan of coding but this guy's passion is enough to make me give it a go
@manalbutt13322 жыл бұрын
That's Great!
@marticus91702 жыл бұрын
This is probably the most intensive lecture of the course so far (I haven't watched the next ones yet). It's a lot of information, I'll have to watch the video 3 or 4 times to process all the information properly haha.
@tryhardjak Жыл бұрын
ha that's what I'm doing lol
@marticus9170 Жыл бұрын
@@tryhardjak Good luck bro :)
@tryhardjak Жыл бұрын
@@marticus9170thanks man, rn i'm stalling on the last project and instead doing leetcode qs :)
@Kiriletto8 ай бұрын
That was dense
@captaingaz8705 Жыл бұрын
Prior to taking cs50 course I couldn't get past week 1, had difficulty understanding problem-solving logic behind loops and functions, This course has been a breeze of fresh air, thanks to cs50 and David's eccentric enthusiasm for teaching ^^
@BullCraftMaxx8 ай бұрын
Yes I love the significantly slower pace on this course!
@TanzidTushar Жыл бұрын
with open("students.csv","a",newline="") as file: use this line for opening the file in order to practice writer method unless you will get extra line which will generate buggy csv file . I was facing the problem and found this solution in stack overflow and it magically worked for me .
@anatoliy4360 Жыл бұрын
I searched right this comment. Thanks :)
@ifeanyiojji Жыл бұрын
Thanks dude struggle with this 1:18:22
@DarkAcademyUniversity8 ай бұрын
🤗🤗🤗
@LukytazcuervoАй бұрын
copilot said the same as you
@minhkhoango1256Ай бұрын
just what I needed, thanks man
@atomicsprinkles54232 жыл бұрын
I've been trying to learn python for awhile now but I don't have access to a lot of courses because of my age, this really broke the barrier and helped me decide to fully jump into the waters and try and make a career from it. Thank you so much
@davidjmalan2 жыл бұрын
Glad you found the course helpful!
@Tweston3ny Жыл бұрын
❤
@HovJigga Жыл бұрын
Hows your path currently going. I'd love to hear qhat you did after and where it took you
@ТатьянаЛарина-ш8у2 жыл бұрын
Дуже гарні курси. Це здорово, коли є такі викладачі.
@ProfShibe4 ай бұрын
fr
@banka990 Жыл бұрын
You make by far the best and most detailed and up to date courses out there. And you are the best teacher, prof. Malan! I would really appreciate if you decided to make a detailed CS50 Django course, as a sequel to this one that builds gradually, and you to be the teacher. I'm familiar with the CS50W, but it looks more like an overview than a course you can learn from scratch and become fluent after finishing. Thank you!
@penteronto Жыл бұрын
If someone is wondering what's the quick fix to problem at 59:20 it's that: name, home = line.rstrip().split( ',' , 1) split accepts two parameters, first is the separator and the second is number of times to split the text because i passed 1 into the function that means that line will be split based on the first comma only. Note that it won't work if you'd have more columns than two so it's generally a bad practice
@floki04075 ай бұрын
its will print harry is in "Number Four, Privet Drive" instead of harry is in Number Four, Privet Drive
@All4You224 ай бұрын
@@floki0407 Don't use quotation then
@patryk5654Ай бұрын
@@floki0407 that's not true it will print Number Four, Privet Drive
@sayori39392 жыл бұрын
Yes file I/O the thing you look up 70 times a day because you never memorize the syntax
@sayori39392 жыл бұрын
That was a lot of information 😖😖
@zakariyahussain16072 жыл бұрын
@@sayori3939 bruv
@Adel-pn2up Жыл бұрын
😂😂😂fact
@yoo81576 ай бұрын
happening now 😂
@mattmurdock63526 ай бұрын
@@yoo8157ah all that indices makes me crazy
@yousefali7552 жыл бұрын
Thanks for your work D/ Daivad and all harvard ! .. a student from Egypt ❤
@energy-sapped61842 жыл бұрын
Great to find someone from my country here too❤
@Sobrietyyy Жыл бұрын
There is no way the students are introduced to this for the first time and even be able to grasp the concept good enough to be able to ask questions about it. I am watching it hoping to get familiar with the concepts and not trying to fully understand before moving on to the exercises since anyone who is challenged with the exercises will have to either come back to this video or search through documentations on how to get stuff done. I'd suggest you to have a go on the exercises even if you don't feel confident since as I've mentioned chances are you are gonna be doing a lot of research anyways before you can actually complete the exercise.
@rengoodman16565 ай бұрын
really helpful tip
@Madvincul3 ай бұрын
Where do you find exercises? I can understand what he is doing when he is writing the code, but I could NEVER come up with a single line by my own.
@adann993 ай бұрын
@@Madvincul If youre find cs50 problem sets then just search "cs50P" on google and youll see the lecture's videos and the problems sets with it
@Sobrietyyy3 ай бұрын
@@Madvincul thats why you should try before you get help, but i will admit this one's a tough one. Exercises are located once you complete the required integration of vscode workspace which i belive instructed on the website. All the course videos have exercises try completing them before you move on to the next video
@Alexchii3 ай бұрын
They're Harward students, though.
@decrepit12 ай бұрын
This lecture and the libraries one, the most enjoyable so far
@oyekanmibamidele61962 жыл бұрын
I'm in Love with coding just because of Jay, the man of the game!
@adeoyedavid29912 жыл бұрын
I just love this guy and this course making programming easy .
@yqhanliving10 ай бұрын
As good and passionate as always. Thanks cs50 team!
@cleidysbrooks2 жыл бұрын
Good Morning Python Family. I late.. David is the best! Thanks 👍
@manalbutt13322 жыл бұрын
Good Morning. Shouldn't it be a Great morning?
@epitomeofrafsan6 ай бұрын
if at 1:04:36 it shows ValueError too many values to unpack, you can use quotechar= ' " ' in the csv.reader function to specify that the quotes represent as a single value, so like this: reader = csv.reader(file, quotechar= ' " ')
@RomiVa...22 күн бұрын
you need to put the Harry's home address in double quotation like this Harry,"Number four, Privet Drive" Ron,The Burrow Draco,Malfoy Manor then it will work all right.
"I make my life more complicated for a moment" 😅 love it!
@nimbabul8384 Жыл бұрын
guys, please, don’t be lazy to press the like button. There are very few such useful videos on KZbin
@jacksonmadison999410 ай бұрын
I never press the like button on any video, because it saves every liked video to a playlist and I don’t like seeing an unwanted playlist clogging up my screen
@smileorcry7204Ай бұрын
@@jacksonmadison9994same reason.but I have liked this video.
@LuisAntonio-ql2tg Жыл бұрын
Thanks David for your passion to teach!
@SaidaYengui2 жыл бұрын
Amazing really good job David!
@Someone-yl8sb5 ай бұрын
This course is loaded with information damn
@labheshsonawane7076 Жыл бұрын
I have a doubt in CSV file handling. So, if we use Comma separated values i.e. CSV file to store multidimensional data, then why do we need the .split( "," ) method to separate these values again? the same thing could be done in Txt file then using .strip( "," ) at 01:01:03 ? The same program runs properly if I just put students.txt file with same data as Csv file used here. then why do we need whole new type of file Csv??
@anishagiri21m2 ай бұрын
I think you need to complete this course first after the python lecture in cs50, then continue with the rest of the cs50. It makes so much sense now that I have already completed cs50.
@Safar_Galimzyanov Жыл бұрын
1:05:00 This approach doesnt work for me for some reason. I get the same error as before: ValueError too manu values to unpack. Ok, it expects commas "" in the csv line
@derekloyer Жыл бұрын
You already solved it, but to make it clear for anyone else looking for it - in the .csv file, he put " " around Number Four, Privet Drive so it looks like. Harry,"Number Four, Privet Drive" telling the CSV functions to not treat text inside the quotes as a separated value.
@bryanflanigan54399 ай бұрын
Had the same issue…thanks!
@Safar_Galimzyanov9 ай бұрын
@@bryanflanigan5439 my pleasure!
@Gab-jj5su9 ай бұрын
I was going crazy with this error, thanks to your comments I figured it out. Very helpful
@andrejg30866 ай бұрын
@@derekloyer Thanks dude, I was also wondering where this error comes from.
On lambda functions, the one given is very simple - if it were a separate function it would only take up one line of code. What happens if you need to do more to the parameter before returning a value - the equivalent of a few lines of work? Would this still work as a lambda function - and if so how would you write it - or is lambda only used for the simplest cases?
@mesaber862 жыл бұрын
"The main difference between lambda function and other functions defined using def keyword is that, we cannot use multiple statements inside a lambda function and allowed statements are also very limited inside lambda statements. Using lambda functions to do complex operations may affect the readability of the code."
@iZusi Жыл бұрын
Beautiful lecture! So detailed and easy to grasp!
@bashehu2 жыл бұрын
I came to peek on the lecture and ended up watching all 😂
@vaibhavagarwal14792 жыл бұрын
this class for me byfar was the hardest code was as friendly as always
@mmulisha10226 ай бұрын
One note in here, is if you didn't have the for thought to ensure the capitalization of the names when passed into the .txt or .csv file, the sorted function also sorts by capitalization. You can clear this up by adding .capitalize(). 23:56
@bigbro18157 ай бұрын
Thanks David
@wesleycao5506 Жыл бұрын
students = {} with open("students.csv", "r") as file: for line in file: name, house = line.rstrip().split(",") students[name] = house #sort by key for name in sorted(students): print(f"{name} is in {students[name]}") #sort by value for name in dict(sorted(students.items(), key=lambda item:item[1])): print(f"{name} is in {students[name]}")
@patryk5654Ай бұрын
1:18:21 it doesn't work for me. I have to specify new line: with open("students.csv", "a", newline="") as file. When I don't, it will use and write data every other row. But when I did it on cs50 web environment newline was automaticly = ""
@BhavyamMittal-gi3jn Жыл бұрын
when I try to code the files costume1.gif and costume2.gif, I have a problem "an error occurred while loading the image". Are there anyone who have the same problem as me, can you give me an instruction to fix this, please.
@fahadahmedmahdi5137 Жыл бұрын
yap bro same case also happened for me
@faizaabdulrasheed9680 Жыл бұрын
Same bro just completed this lecture and not able to do upload images to vs code. Did you get the solution yet??
@andrejg30866 ай бұрын
@@faizaabdulrasheed9680 I had that error because of the antivirus program. Only after disabling it was I able to upload those images.
@HairoHeria6 ай бұрын
have the same problem even right now
@andrejg30866 ай бұрын
@@HairoHeria In my case, the antivirus program (Kaspersky) was blocking the loading of those images. It was only when I turned it off that they loaded.
@sushmasingh90402 ай бұрын
can't we do this in 46:44 with open("cs50_ch6.csv") as f: for l in sorted(f): name,house= l.rstrip().split(",") print(f"{name} is {house}") why do everything
@grishmakhanal165520 күн бұрын
yes it will work you just did it in a different format
@abanaru Жыл бұрын
At the inverse sorted question (25:42), first thing which came to my mind was to use slicing, which was discussed in a previous chapter. Then line 7 would become: for name in sorted(names)[::-1]:
@expect_DanError3 ай бұрын
for _ in cs50p: print("I love it!!!")
@edmund89544 ай бұрын
49:10 How does giving the sorted() function the key get_student(), which is comprised of just strings make sorted() know to sort by alphabetical order?
@kvelez Жыл бұрын
printed_names = set() with open("./names.csv") as file_csv: for line in file_csv: name, house = line.rstrip().split(",") student = {"name": name, "house": house} if name not in printed_names: print(name, house) printed_names.add(name)
@miaomar3228 Жыл бұрын
Could the key in the sorted function at 53:06 instead of get_house be student[“name”] or student[“house”] ?
@caiofernando6 ай бұрын
Per the documentation key should be a function that returns the values to be sorted.
@caiofernando2 ай бұрын
@SlimyBlockhead key has to be a function. What sorted() does is it feeds each variable to the function and uses the returned values to sort.
@k.o.o.p.a.2 жыл бұрын
holy information overload batman
@marcosernestogarayracca29288 ай бұрын
excelent
@DarkAcademyUniversity8 ай бұрын
excellent :)
@TanzidTushar Жыл бұрын
if your code shows error like Module not found , you can do pip install pillow in your terminal and then it should work fine . in my vscode it didn't work by default so I had to install the package through command line .
@ProgrammerPenguin Жыл бұрын
the costume1.gif and costume2.gif doesn't work it shows an error "an error occurred while loading the image vs code"
@BhavyamMittal-gi3jn Жыл бұрын
I have another problem that is when I import Image from PIL(i type "from PIL import Image"), it says that the module doesn't exist because of which i can't even use image and the saving part
@gregcruz6517 Жыл бұрын
when i do the code at 18:53 , it will print each list item as a list item. i find add [0] to the end for each name, as before.
@kevinchou128026 күн бұрын
had to watch three times to understand this lol
@samuelmiscik56674 ай бұрын
51:00 sorted(students, key=get_name, reverse=True) Does (students, key=get_name) just looks at every key (name) in dict and just makes a list out of them? Because i have no idea and i dont really get how it works....its because of the key=get_name? Shouldnt there be some kind of append or something? I am really confused can someone explain how it works? thanks
@farhanishraq5812 Жыл бұрын
can you please make a series for java?
@hajarbenabou7040 Жыл бұрын
I have a question: When I try to submit my work in the problem set, I can't submit my other file(the one that we will count its lines) Am I doing something wrong or it wont be submitted anyway ?
@BT-te9vx2 жыл бұрын
firstly, thank you for the course & simplest explanations. Although I have "kind of" figured it by experimentation, I still am not very clear on the parameter naming in the lambda function. what I mean is, in the given example, could I use any name(parameter) after lambda(instead of "student") - i realised after multiple tries that I had to change all names (and it is demotivating to realise that I don't understand something very basic here). For eg. the original code was for student in sorted(students, key = lambda student: student["name"]): print(f"{student['name']} is from house {student['house']}") I wanted to check my understanding and change the parameter name in the lambda function to something else (like 'x') - and something like this doesn't work for student in sorted(students, key = lambda x: x["name"]): print(f"{x['name']} is from house {x['house']}") what ultimately works (and is obviously the right approach - BUT I JUST DON'T "GET IT") is : for x in sorted(characters, key = lambda x: x["name"]): print(f"{x['name']} is from house {x['house']}") will rattle my brain more on this - but if someone has some tip to make me understand this better, I'd be obliged. TIA and keep learning
@lukimaster2 Жыл бұрын
for student in sorted(students, key = lambda x: x["name"]): print(f"{student['name']} is from house {student['house']}") Should work
@joynil72117 ай бұрын
Hey, David. To begin with, I'd like to thank you for such an amazing course. It really has helped me a lot in my journey to learning python. So, I was trying to practice the PIL library function on my own using the cs50.dev . But I'm unable to upload or open the .gif images. It'd be great if you could just help me with it. Tell me how to import images on Virtual Studio code for cs50. Thanks
@joynil72117 ай бұрын
Also, I believe I need to add extensions for that. If that's the case, can you suggest me some verified working good extensions? I'd be grateful.
@JahKor-ht8rd5 ай бұрын
pls about the csv reader, after running the codes mine repeated for four times and i dont know where my bugs coming from pls Need and a hand on this A S A P.
@jacquessantiago Жыл бұрын
When he wanted to change the data storage format "txt" tile into "csv", He created a new file. Is it possible to convert a txt file to csv file from our code?
@Hellmiauz5 ай бұрын
import os os.rename('names.txt', 'names.csv') you can o that. it's just changing the file extension. since both are "plain text" files there's nothing special about them, both are files that contain text, one happens to have commas.
@Stella2U Жыл бұрын
How do you do math operations on values? IEven with adding int(value) , it gives errors.
@mj-pt2ty3 ай бұрын
why does it say an error has occured when i try accessing the gif?
@DuongThiMinhThu_ Жыл бұрын
when I trying to code the files costume1.gif and costume2.gif, I have a problem "an error occured while loading the image". Are there anyone who have the same problem with me, can you give me an instruction to fix this, thank you.
@cheeseballs9579 Жыл бұрын
did you find a fix, i've been trying for an hour now
@sakethreddyburugu1156 Жыл бұрын
@@cheeseballs9579 I've had the same problem but I resolved it by : 1. Download the image from the source code if you haven't. 2. If you've accidentally installed PIL instead of pillow, you'll have to delete PIL first and then download pillow. 3. And then I installed PIL from my command line and it somehow worked for me. 4. Sometimes installing library off the path could would lead to errors when we try to use the libraries, so do check for it.
@ifeanyiojji Жыл бұрын
For this part 1:31:23 right here if your file isnt working try creating a variable specifying the name of the gif files
@pgaming1832 жыл бұрын
Can I use a file in both append and read mode by using two with methods
@chrisfielding1432 жыл бұрын
I know this is not what you are looking for coz your question asks for a single file, but you can write a new file while reading from an existing file. Here is an example: with open('names3.txt','r') as f: names=f.readlines() for name in names: print(f'Hello, {name.capitalize()}',end='') with open('names4.txt','a') as file: file.write(f'Hello, {name}')
@abdullashafi580 Жыл бұрын
you wrote the codes , I wrote the codes you ran the codes, I ran the codes your code works, but mine....
@pstefanics Жыл бұрын
In the students.csv file, did you put quotes around "Number Four, Privet Drive" ? :)
@jagzey Жыл бұрын
@@pstefanics that had me stuck, forgot that i had to have the speech marks for DictReader to interpret it correctly
@sayori39392 жыл бұрын
Oooo can I've heard pil comes with converting functions, so can we build a file converter with it? :3 maybe that will be my python's final project
@Analyzing_eye7 ай бұрын
where do i practice these problems
@jashwanthbablu856 Жыл бұрын
Sir but I have one doubt, in real life scenario where we use these files I/O , please clarify this please sir
@davidjmalan Жыл бұрын
Whenever you'd like to read information from files, or save information to files!
@italiaman8 ай бұрын
for the gif thing, images must have the same dimensions
@hand-eye45172 жыл бұрын
58:03 if only real life worked like that with a few lines of code . "I'm gonna change this house into a home"
@stuartlevybaseball3604 Жыл бұрын
I am having issues with the csv.DictReader. When I enter in the information exactly as it is on the screen, it is saying that "name" and "home" are not defined. Help
@stuartlevybaseball3604 Жыл бұрын
Or it will say KeyError: 'home' and I have entered in the syntax the exact same as on the screen. Was there an update or something?
@stuartlevybaseball3604 Жыл бұрын
Wait nevermind. I had a space on my csv
@meynoush5356 ай бұрын
I was trying to create gif file with three pictures, instead of two. Yet it didn't work. can someone please help me?
@meynoush5356 ай бұрын
I resolved the bug by just adding other images to the list of append_images. Such that append_images=[images[1], images[2],... images[n]] Hope somebody finds it useful.
@alptug Жыл бұрын
I am really struggling to find a clean way to delete one row from csv file for example i want to delete "name": "harry" really couldnt find a way
@luanpires1784 Жыл бұрын
I've searched for how to delete a dictionary from a list in python. You can do it like this: import csv students = [] with open("students.csv") as file: reader = csv.DictReader(file) for row in reader: students.append(row) for i in range(len(students)): if students[i]["name"] == "Harry": del students[i] break for dictionary in students: print(dictionary)
@alptug Жыл бұрын
@@luanpires1784 thanks a lot for the reply i will check once i get back
@osmansafi4517 Жыл бұрын
I am an Electrical Engineer want to learn python for my project for data alalysis, machine learning etc. is this the right place ? NEED your HELP.
@sudipadhikari8698 ай бұрын
How to download PIL library ??
@relaxer73296 ай бұрын
Pip PIL install
@pgaming1832 жыл бұрын
What happens if we open a file that does not exist with read mode
@jagzey Жыл бұрын
try it
@qianwang86392 жыл бұрын
looking forward lecture7&8
@manalbutt13322 жыл бұрын
Yes! Regular Expression and Object Oriented Programming are your next ones. You got this.
@sayori39392 жыл бұрын
Regex... I think... I may die in that one also OOP i never could understand any program using oop even if it had simple logic( I KNOW what class is, inheritance and all oop stuff) , that always made me mad i hope david can close that gap 😢😢😢
@zakariyahussain16072 жыл бұрын
@@sayori3939 bruv i seen u everywhere commenting on the CS50 stuff
@sayori39392 жыл бұрын
@@zakariyahussain1607 :3
@zakariyahussain16072 жыл бұрын
@@sayori3939 send me ur disc
@yousefali7552 жыл бұрын
Still waiting 🖤
@Chibudomobasi2 жыл бұрын
4 years later and he still dresses the same
@roitv24632 жыл бұрын
I'm waiting
@kojo74852 жыл бұрын
I'm learning 😌
@thatsawesome.2 жыл бұрын
Jeez!
@MisterK-YT2 жыл бұрын
Every time I see the puppets I lol.
@gaganarora46565 ай бұрын
David Malan for President 2024
@codelivewithme2 жыл бұрын
dot making extention in vs code ? ? i need )/
@sayori39392 жыл бұрын
I believe that's a setting not an extension I'm not sure, maybe search "indentation" in the settings
@monicagalloriofrio95512 жыл бұрын
this is really usefull.. David you tipe soooo fast..
@codelivewithme2 жыл бұрын
dark mode will be more perfect fit
@TheNuncFluens9 ай бұрын
David always wears black not enough contrast
@kylofps2 жыл бұрын
My brain hurts! (this is a good thing)
@taimurkhan38812 жыл бұрын
Waiting...
@rukiyearcan21922 жыл бұрын
great course, great professor really but enough about this harry potter
@LAAL0_O5 ай бұрын
can't wait for the exercise to be 20x harder than this lecture.
@amine63404 Жыл бұрын
01:14:04
@jb6164Ай бұрын
1:24:24 I am not able to load the image - returns An error occurred while loading the image. Anyone can help to fix it?
@sulimansal29902 жыл бұрын
in c or ...?
@yousefali7552 жыл бұрын
Think in python
@JamesRodriguez107832 жыл бұрын
@@yousefali755 Python. Nooo, god. Please stop.
@manalbutt13322 жыл бұрын
This course is called CS50P, which means CS50, programming with python. You can find the course here: cs50.harvard.edu/python/2022/ And you can find the week 6 here: cs50.harvard.edu/python/2022/weeks/6/
@Patriot513Ай бұрын
I'll call it "Jiff" when "Graphics" from Graphics Interchange Format (GIF) is pronounced Jraphics... :D
@sushmasingh90402 ай бұрын
btw david sir looks like moriarty
@pushpakumari18017 ай бұрын
1:05:34
@DM-ul5yc5 ай бұрын
"People are the problem" that's what a robot would say.
@ednja7 ай бұрын
David Malan must be an AI character because it's been 7 weeks and he hasn't changed his clothes since the 1st week.
@lilninja9372 жыл бұрын
I refuse to call it a jif 😤
@Xero-232 жыл бұрын
Bruh why did youtube think that im interested in this video?
@manalbutt13322 жыл бұрын
Everyone should be. It is a well-taught course. I have taken it. And you should too.
@Xero-232 жыл бұрын
@@manalbutt1332 i know absolutly nothing about this course it was just randomly recommended to me
@manalbutt13322 жыл бұрын
I knew nothing too. You can start watching from week 0, up to this one. You will understand everyhing.
@sayori39392 жыл бұрын
Bc sometimes yt recommends quality stuff instead of click bait with inappropriate thumbnails :3 it's a sign, learn programming! Uuuuuuuuu
@ken3053 ай бұрын
35:00
@huwrw007 Жыл бұрын
25:00
@error0792 жыл бұрын
python is f'ed up. where is the data read? I see no more file.readlines()