pre labeling 0:01:27 Content of Lecture05 0:02:32 New data type : Tuple 0:04:04 tuple slicing 0:05:35 tuple swapping 0:08:00 0:09:09 Manipulating tuples 0:13:00 0:12:00 0:15:31 New data type : List 0:16:00 0:18:00 0:19:43 Operation on list 0:20:00 0:22:00 0:23:15 Operation on list 0:26:55 convert list to string and back 0:28:00 0:29:16 Operation on list 0:31:52 An analogy 0:34:04 idea of Aliasing 0:36:54 Idea of Mutate 0:38:45 Nested List 0:40:17 Mutation and iteration try this python tour
@leixun4 жыл бұрын
*My takeaways:* 1. Introduce compound data type 1:05: tuple and list. 2. String of a sequence of character data, tuple is a sequence of data in any type 1:35 and is immutable meaning that we cannot change it once we created it. 3. Why we want to use tuple 5:20. 4. List is a sequence of data in any type 14:55 and it mutable. 5. Aliases 34:00. 6. Cloning 35:15. 7. Sorting lists .sort() vs sorted() 36:30.
@algemmegla90024 жыл бұрын
39:56 Mutation and Iteration. :D
@frankhuang50953 жыл бұрын
Thank you MIT for providing such invaluable content to the public! Thank you!
@JacobKrajewski6 жыл бұрын
The person that edited this video did not do as well as the other, previous lectures. When she is literally pointing at the board, the person kept showing us video of Ana, as she is directing attention away from her to the slides... And then didn't show the slides after she was done talking. The other videos were all done really well by contrast.
@kaiwalpanchal58723 жыл бұрын
came to say that exactly
@percih707 жыл бұрын
Python Tutor is such a good idea, it really helps show the concepts, well worth trying.
@kararkhan98224 жыл бұрын
Thank you MIT , I am a non-IT student and understood everything.You are doing a great Job!! So far completed 2 courses taught by MIT online learned Alot ;)
@Liaomiao7 жыл бұрын
camera could really focus on the slides a lot more
@garthhh7 жыл бұрын
You can download them in PDF format from the link in the description and follow along that way
@l_combo6 жыл бұрын
or do picture in picture, you get that when you do the EDX version of this course (also free but more structured)
@911Dagur6 жыл бұрын
I assume she is talking about when the teacher points at the slides to show the students something with her cursor/laser pen and the camera stays on the professor. Makes it kind of hard to be fully aware of what she is referring to when she says "right here" or "over there". They should rather film the slides more to show what she points at on the slides.
@marklvrd6 жыл бұрын
There is really no point to looking at the Professor, unless they are using the board.
@jetspray35 жыл бұрын
Cameraman did a really poor job.
@aritrachatterjee80576 жыл бұрын
Thank you, Dr. Ana for making OOPs and Inheritance so simple. I could not get concept at first when i was going through MIT 6.00. But now i am equipped with the understanding and assignment problem(6.00) is "walk in the park ". Thank You. May Cosmos bless you with more knowledge...
@user-pe9qg3hg3k2 жыл бұрын
Dr Ana Bell is absolutely phenomenal at what she does. What an amazing explanation again. I can't believe MIT has such high quality content up there available for free.
@TheFootballPlaya3 жыл бұрын
great video. python, while it's syntax is simple, that simplicity in some ways serves to detract from what is actually happening and how things are processed. It's more apparent when you compare python operations to something like that of c++, where you realize how much python does for you. Other than information hiding, it's a lovely language.
@joost37323 жыл бұрын
Ana explains all the theory very clear. Already knew most of the python she explains but it still helped me understand the big picture of programming
@theodorejonathan64603 жыл бұрын
Same with me. She is a great. Feminine power
@peasant72143 жыл бұрын
@@theodorejonathan6460 ?
@theodorejonathan64603 жыл бұрын
@@peasant7214 Hi!
@akbarrauf27417 жыл бұрын
thank you ,mit
@aritrachatterjee80576 жыл бұрын
Thank you, Dr. Ana for making this so simple. I could not get concept at first when i was going through MIT 6.00. But now i am equipped with the understanding and assignment problem(6.00) is "walk in the park ". Thank You. May Cosmos bless you with more knowledge...
@Saganist4207 жыл бұрын
I really love her subtle humor.
@rajeswarynarasimman3728 Жыл бұрын
Very helpful video indeed. Please show the slide always. Preferably, the slide and the professor together, maybe as picture in picture.
@Iain.G.D.B3 жыл бұрын
Great tutor and lessons however I would like a picture in picture of her and to be able to see what she is pointing at on the screen. hard to follow when you cannot see what she is pointing at.
@jaimemontero2343 жыл бұрын
Good lectures , clear slides and Dr. Ana Bell very , very good professor . Tanks MIT to give us thats extraordinarys open courses .
@hamids45507 жыл бұрын
camera needs to focus more on the board so we can see what she's talking about rather than just seeing her without the content. It's annoying sometimes
@Noldy__7 жыл бұрын
Click on the link in the description. The lecture pdfs are there and you can use them to follow along.
@tripleplay47 жыл бұрын
Yes but we can't see what she is drawing or pointing at in that case. Camera should at a minimum be on the slides when she is looking at the slides.
@bee_irl4 жыл бұрын
@@tripleplay4 She is pointing with a laser pointer usually. For us to be able to see that, there would need to be a second camera that focuses only on the board (it would be too much movement for this single camera), and even then, we could barely see the laser dot. I don't find it very hard to follow along on the pdf.
@sapphirelovespj7 жыл бұрын
When she's talking about the contents on the projector screen, can you show more of the screen?
@Noldy__7 жыл бұрын
Click on the link in the description. The lecture pdfs are there and you can use them to follow along.
@jasonzhang6534 Жыл бұрын
Thanks for the video. It really helps me to fully understand the difference between a tuple and a list.
@yovelavitan88545 жыл бұрын
on the last problem you can search l2 instead of l1 as shown below: def k(l1,l2): for n in l2: While( n in l1): l1.remove(n)
@jhw86855 жыл бұрын
u cant look into l2 and remove from l1 instead. the remove function only removes the first occurrence of the element n in the list, not all element n. l1 = [1, 1, 2, 3, 4] l2 = [1, 7, 9, 7, 0] u will end up with l1 being [1, 2, 3, 4] and l2 stays as [1, 7, 9, 7, 0] and there is still a duplicate
@yovelavitan88545 жыл бұрын
@@jhw8685 thank you for the correction, I now changed the code above and I think it's correct now
@911Dagur6 жыл бұрын
I love that you put these lectures out for everyone to see. But wouldnt it be better to be able to see what the professor is pointing at on the slides? Makes it hard to understand what she is talking about when you can't see what she is referring to.
@InventTwig6 жыл бұрын
visit the ocw website for the ppts
@georgitanev-w4b7 жыл бұрын
I like this lectures. High level of education. Thanks :)
@btvaalburg5 жыл бұрын
This prof is amazing!
@UnmannedsRandomStuff Жыл бұрын
no idea what is going on when using laser pointer to point at the physical screen where couldn't see in this video.
@jetspray35 жыл бұрын
The camera focus screwed up the whole thing but even though the doctor is good at teaching.
@MrFaiqueShakil4 жыл бұрын
So much concept in this lecture.
@nancylu40493 жыл бұрын
Wonderful! learned a lot! (It would be great if the camera man focused on the slides when Dr.Bell was pointing at them.)
@CrushOfSiel3 жыл бұрын
Darn, a lot of this information would have been great to do the hangman assignment! I did it all with strings and it was a bit challenging and probably hard for another programmer to follow in some areas. Lists are awesome.
@akshayalva38793 жыл бұрын
yeah man, I'm still trying to do that, as I'm watching this vid
@peasant72143 жыл бұрын
well I used ' '.join function at the assignment before I watch this lecture
@RamkrishanYT7 жыл бұрын
lol ...when she says she's being modest about Justin
@senanurarslan23236 жыл бұрын
i wish i could see the slide
@deeptadevkota51065 жыл бұрын
You can download the slides using the link provided in the description.
at 19:19 a list was not created yet. Can someone explain how this works
@peterlin23525 жыл бұрын
i have no problem with the camera focus. I think it is great to point to the speaker for her great presentation skill. A good skill to learn for me.
@loptrfawkes2149 Жыл бұрын
I'll make a comment on it, since for some reason this really confused me: why .sort() returns none. (If I get something wrong, feel free to correct me and I will edit this comment, I am new to coding.) The reason that list.sort() and list.reverse() return None, while sorted(list) returns a list's values, is basically that the methods are completed by different means. Code that returns None is completed "in-place," which means that the original variable itself is not duplicated, only changed. Python does not want you to think that a new variable has been/could be created after running the method .sort() or .reverse() (or any other in-place method), and so it returns None. It is basically telling you that any method that is done in-place CANNOT generate a new variable because it has not duplicated the old variable. Meanwhile, sorted(list) is creating a new list entirely, and so you can assign it to a new variable name. ( sortedList = sorted(originalList) ) So basically, don't assign in-place methods to any new variables.
4 жыл бұрын
5:28 what are they useful for
@techcorp6 жыл бұрын
Bad editing. Makes watching this otherwise wonderful lecture a grind.
@rockren8236 Жыл бұрын
The lecture is great, but the camera man should be fired. 10:47 Show us what professor is pointing at!!! OMG!
@russellfatemi46163 жыл бұрын
Thank you professor Bell
@lanhaibibolanhaibibo14617 жыл бұрын
great lecture. Was just wondering, which software do you use to create the lecture slides?
@draftingsavant71907 жыл бұрын
lanhaibibo lanhaibibo powerpoint
@lanhaibibolanhaibibo14617 жыл бұрын
@drafting savant, Which trick is it called in using powerpoint? Is it possible to do it using latex?
@manuelignacioperezcarrasco63117 жыл бұрын
I think it's Beamer, a latex tool to create slides.
@Pkmafffy7 жыл бұрын
I have two questions: 1. How do I create a tuple, e.g. ((1, a) (2, b) (3, c)), without manually inputting values? 2. I can't figure out how to return an updated list from a function. Every time said function takes in a new input, all old values of local variables are forgotten and a new list is returned instead of an updated one. These questions are in regard to problem sheet 2 - Hangman. Any advice would be greatly appreciated!
@EgeOnatDoguslu6 жыл бұрын
github.com/egeonatdoguslu/MIT-Assignments/blob/Hangman/Hangman I completed the assignment. It might not be the most efficient one for now but, its working. Im sharing that it could give you some clue.
@edderiofer4 жыл бұрын
In that last example, couldn't one iterate through the list backwards?
4 жыл бұрын
15:00 inmutable and mutable
4 жыл бұрын
0:45 recap functions
@imas12394 жыл бұрын
I ( we ) need a course from u just to define all these different words you use in most of ur analysis? ???
@RyanScarbrough Жыл бұрын
Thanks for this! Mutable side effects are annoying! x_x
@briannestor51257 жыл бұрын
I am curious as to the advantage of using a tuple over a list. It seems as though lists have the exact same functionality as tuples but with the added advantage of you being able to modify them(mutability) if you so choose to. Why not just alway use lists?
@rhodesclosed95637 жыл бұрын
I believe lists use more system memory
@raphaelcrespo37256 жыл бұрын
it an option for a 'list' that you wanna make sure that doesn't change along the code.
@geethabr3745 жыл бұрын
Because lists may change while code execution and cause unintended output generation. But tuples never modify and that is the added advantage.
@kobbyfynn80433 жыл бұрын
Since lists are mutable, they cant be used as keys in a dictionary, but tuples can. So that's one reason to use tuples over lists sometimes
@unloadinggnat33965 жыл бұрын
13:25 Who is Joe
@najsh23 жыл бұрын
For the last L1, L2 question, I've tried it with the first code but got L1 = [2, 3]. Is that because Python has been updated to fix that issue??
@wilcohermens34922 жыл бұрын
Tried the code myself, it didn't work. Maybe you have changed the order of the list? Or did you assign a new list and didn't rerun the code with the original list? Besides that, python has a more simple way to remove the duplicates, try the following: L1=[1,2,3,4] L2=[1,2,5,6] L1=[ e for e in L1 if e not in L2] print(L1)
@yongshengtay80163 жыл бұрын
Comparing the current course available on edx and this, I still prefer the full lecture length videos from Fall '16. It's a lot more compact but it's easier to stay focused.
@vidieo__3 жыл бұрын
ikr. i tried the edx course but i honestly still prefer a recording of an actual classroom! the only downside is that you don't know how well you do on the problem sets.
@dhruv_aditya3 жыл бұрын
Thank you mit open course to provide us wonderful lectures . 🇺🇸 ❤ 🇮🇳
@utkarsh22smart5 жыл бұрын
What is the difference between append and extend of the list.
@ficklampa15 жыл бұрын
L = [0,1,2,3,4] L.append( [101,102,103] ) L = [0,1,2,3,4, [101,102,103] ) L[5] is [101,102,103] L = [0,1,2,3,4] L.extend( [101,102,103] ) L = [0,1,2,3,4,101,102,103) L[5] is 101
4 жыл бұрын
2:37 how to represent a tuple
@liza10o5 жыл бұрын
What does that \ do after max year?
@obli89843 жыл бұрын
Obli is getting progress
@infinitasfish54992 жыл бұрын
Thank You very much!
@devkiosk6 жыл бұрын
What is the difference between the extend and append functions?
@nahfid20036 жыл бұрын
search on google, it's a popular question
@geethabr3745 жыл бұрын
Append can add only one element at the end of a list while extend can add multiple elements to an existing list. When you try to add a list at the end of a list using append, it creates ONE element which is again a list and adds it to the list. But extend considers each element like a separate entity and adds it to the list.
I have a confusion, If tuples are immutable how does nums = nums + (t[0],) work?
@SameAsAnyOtherStranger2 жыл бұрын
Not sure what context you would use that in, but zero value listed tuples are asking for a return of "false" because that's a boolean if/or/else statement.
@avernvrey74222 жыл бұрын
it's concatenating an empty tuple to a singleton tuple (and on and on as the for loop runs). Consider; nums = 'walk' nums = nums + 'ing' print(nums) will output walking. 'Walk' and 'ing' are immutable as strings, but they can be concatenated together. In the same way a tuple can be concatenated to a tuple. nums = (1,2) nums = nums + (3,4) print(nums) will output (1, 2, 3, 4) What it's not doing is changing an element within a tuple, as tuples are immutable.
@peterhind9 ай бұрын
Tuples are immutable, meaning once they are created, their contents cannot be changed. However, you can create a new tuple by concatenating existing tuples together. This doesn't modify the original tuples but rather creates a new tuple containing elements from both.
4 жыл бұрын
1:40 tuples
@kamranasif2126 жыл бұрын
Very informative
@aghaaslam95754 жыл бұрын
It would be better if the Slide and the lecturer are split in a video
@Alikhan-ee7bs5 жыл бұрын
very helpful Could you share the code link and the PPT slide for such kind of code?
@mitocw5 жыл бұрын
Code snippets and lecture notes are available on MIT OpenCourseWare at: ocw.mit.edu/6-0001F16. Best wishes on your studies!
@KrishnaDasPC5 жыл бұрын
I have started a new github site with the code snippets which is currently work in progress. you can have the running examples for the Video 3 here pckrishnadas88.github.io/MIT-6.0001-Introduction-to-Computer-Science-and-Programming-in-Python-Fall-2016/#/ch03/README
@yusufmohammed44524 жыл бұрын
That's the only thing I don't like about these videos...when the professor is calling attention to something on the board the camera person just keeps staring at the professor. Can we see what's she's referring to? It's kinda frustrating.
@jyvben1520 Жыл бұрын
Sadly we never see where she is pointing to, makes it a bit more difficult to follow, showing her waiving her arm is useless. Hope the latest videos produced by MIT fix this (if any), maybe some bright spark can solve it or solved it. And give her some rubber bands to keep her shirt sleeves up ?
@quocvu9847 Жыл бұрын
10:43
@Xpeedspiderman Жыл бұрын
I found something wrong which q=0 is right but the r = 4 is not true .
@bactran97243 жыл бұрын
so Python knows to map min_n and max_n to min_year and max_year....?
@avernvrey74222 жыл бұрын
as long as the order is correct to what you want. The variable names don't matter, it's the order that matters.
@algemmegla90024 жыл бұрын
Regarding: 39:56 Two lists, remove same value - Mutation and Iteration. Just thought I would share what I did: def remove_dups(L1, L2): L1_copy = L1[:] # Make a copy of L1 first, or iteration gets messed up. for e in L1_copy: if e in L2: L1.remove(e) print("iteration:", e, "list:", L1) # Prints each iteration number, along with the list. L1 = [1, 2, 3, 4] L2 = [1, 2, 5, 6] remove_dups(L1, L2) #--------------------------------------------------- print("", "-" * 30, "") # Puts a space/line/space between the two outputs. def remove_dups(L1, L2): for e in L1: if e in L2: L1.remove(e) print("iteration:", e, "list:", L1) # Prints each iteration number, along with the list. L1 = [1, 2, 3, 4] L2 = [1, 2, 5, 6] remove_dups(L1, L2) #------------------------------------------------------------------------------------------- ''' Output (you can see where it skips the second iteration): iteration: 1 list: [2, 3, 4] iteration: 2 list: [3, 4] iteration: 3 list: [3, 4] iteration: 4 list: [3, 4] - iteration: 1 list: [2, 3, 4] iteration: 3 list: [2, 3, 4] iteration: 4 list: [2, 3, 4] '''
@HealthyFoodBae_4 жыл бұрын
Thanks
@brainstormingsharing13093 жыл бұрын
👍👍👍👍👍
@PasangWangdi4 жыл бұрын
MIT need some camera training
@gr8b8m855 жыл бұрын
And this is why university is better than random youtube videos.
@DarkellVein2 жыл бұрын
So, if you make a variable, equal to another variable, you are creating an alias. So, if var1 = var2, then var1 points to the same memory address as var2, making it a pointer to var2. Coming from c++ it seems weird that when assigning var1 to var2, it makes a pointer, instead of a copy. And instead, having to specify when do you want a copy... But it's ok, as python's thing is being syntactically simple and it also reduces the garbage to collect, etc, etc.
@craigdanielmaceacher3 жыл бұрын
FYI don’t use capital “L” as a name, or capital L for anything in python code, it’s not idiomatic python, use a more descriptive name, and avoid capital letters, especially single capital letters. I understand why they did it though, for an example you don’t need a long name and lowercase “l” is hard to discern from the number 1 with a lot of fonts. Get yourself a monospaced programming font like Hack to help!
@hossainurrahman67003 жыл бұрын
Mam is very beautiful
@markmilan57 Жыл бұрын
I thought python runs from up to down. Your lists mutability shows down to up.
@vigneshr95776 жыл бұрын
Functions and methods are same, isn't it?........
@kirankalyan56746 жыл бұрын
Vignesh Prasanth yep they are 👍
@geethabr3745 жыл бұрын
No, they are not. Functions are generic. On the other hand, methods are functions that can only work with a specific data type. For example len( ) is a function because it can work on all the series type of data types like strings, tuples, lists. But append( ) is a method because it can only be used with list.
@norgileatmonseaur66984 жыл бұрын
Ah yes, when a concept is being explained the logical course of action is to quickly cut away from the slides.
@beeilve6 жыл бұрын
I feel like she didn't explain aliasing, mutability or cloning clearly.
@geethabr3745 жыл бұрын
Refer to John V Guttag's text book. She's using the same and concepts are clearly and concisely explained in the book.
@micmikeАй бұрын
Thanks. I would like to remind you that we listen to the instructor, BUT we look at the instruction example! Do you get it? Ana is nice to look at but the examples she is talking about are necessary to understand the lecture point! Focus on the coding examples please, not the instructor. Thanks
@mitocwАй бұрын
There are code snippets and slides that may help you. Visit the course on MIT OpenCourseWare for more info and materials at: ocw.mit.edu/6-0001F16. Best wishes on your studies!
@keqi28924 жыл бұрын
Why Dr.Bell always wears the same clothes every-course?