Absolutely love this professor's method of teaching! It is very well explained! (As I would expect from an MIT professor.) Also, thank you, MIT, for the free knowledge. It is very important! Just as an FYI, these lectures feature older versions of Python, so there are a couple of differences (as far as what I can think of right now and are plausible to what he is teaching): (BTW these only apply to Python, not all programming languages; each one have their own set of syntax rules.) - The '/' operator now provides real solutions (e.g. 9/5 is 1.8). It seems to convert the VARIABLE into float automatically - you can check that by assigning a division to a variable (as an example, [value = 9/5]) then typing the command [type(variable)] (in my case, [type(value)]) and it will give out "float". It will not do that, however, if you use the operator "//", which is an integer division - the variable will be set as the int type (integer); - You CANNOT compare a string with a number anymore: it now gives out the expected TypeError; - Print statement goes with parenthesis now. Should be [print('statement')], not [print 'statement'] - it will give out SyntaxError without the parenthesis. - 'raw_input()' has been changed to 'input()' and the original 'input()' does not exist anymore. Source with more details found on stackoverflow. - 'while' loops do not take parenthesis anymore - they are not needed. However, no error message will be given out (taking base from Python 3.7). This also applies to 'if' statements. Again, thank you MIT for the awesome lectures! And thank you, reader, for paying any attention to my comment! :)
@@theadel8591 TLDR: No, not at all! Most of what the course covers includes the key features newer versions still have as well. Python is such a nice language that, while the versions are different and there are improvements/modifications, the versions are similar enough that it is still an incredible course. However, very important to note that, depending on your usage, it is good that you learn both this version and newer ones - there are companies, as an example, that still uses Python 2 for their software. In any case, if you learn from this course, you'll find it is way easier to learn the differences later and it will not be hard to adapt your code. Hope this responded - if not, please comment again and I'll be sure to answer! :D
So far I've found and have taken one entire course from the University of Toronto by Dr. Jordan Peterson and now working on the Harvard CS50 and this MIT 6.00 lecture; if a person doesn't educate themselves it's due to their own choice, the resources available now are limitless. You can ask all of my notebooks, I take notes for every class and ensure a good night's sleep after that lecture and lab, so far that's been my recipe for moving data from short term to long term memory. Thank you @MIT for making these available to the public, I'm truly grateful.
Could you pass along my thanks to the professors and whoever came up with this idea. These videos are a Godsend for someone who has to repeat segments over and over again due to an extreme case of ADHD. I could not sit through an actual class and get this without my mind wandering across any and every other possible subject.
I love these, it don't like my prof he's not very effective at teaching this stuff, i have no background in computer science and my first day my prof went into so much stuff and i have no idea what he was talking about but I'm learning alot from these videos!!
This happens in real life at universities also. The first lectures are a deluge of people queuing 10 minutes early, eager for those doors to open. By mid term a third of the seats are empty and people are walking in 5 and 10 minutes late.
ease off with the judgements. there could be a lot of reasons. they might have found better resources, schools, materials, etc. MIT's OCW isn't the only high quality resource available. or they could have moved to a new place where access to youtube or any OCW is restricted, they could have gotten killed etc. one thing's for sure tho - we don't know shit about them.
Professor Grimson is an "off the hook" orator. He breaks down programming in a way that allows even the thickest of students to understand the subject matter and make educated decisions. Kudos for teaching in Python. It is a powerful language but closest to "easy" that you can get in programming. Well done, Gents. Cheers.
10:54 They seem to have taken the feedback, since in Python 3.8 this is no longer possible; it will no longer assume you want to compare the value expressed by the string if the other parameter is not also a string. In other words: If both are numbers, or if both are strings, it WILL compare their value, but if one is a number and the other a string, it will throw an error message.
I'm new to programmin and i felt in love with Python the second i ran it, and i never tried to program before. But it was kinda hard to find a lecture or tutorial as good as this OCW. I always dreamed of e going to MIT, but being brazilian never helped, but now i can at least have a lil taste of it.
Thank you for these VDO. It helps to undetstand more about coding and programing for me, a person does not know anything about coding,but only languages for my living. Please keep this good work on. I love this professor and his lecture.
Excellent professor. He explains everything with precision and clarity. I wish my programming professor was like this man. If you're having trouble try Bucky's tutorials for additional clarity. Definite subscribe.
Most important with employers are the following: 1) Can you follow a routine for long periods of time (years) ? 2.) Can you complete a task that you've started ? 3.) Can you work under the pressure of a schedule ? 4.) Can you work within the system, as opposed to doing it your own way? 5.)How do I know, BEFORE I hire you, that you have the skills you say you have? 6.) Is there some way I can verify that your skills have been tested ? 7.)
i love this. if i were an older person taking this course and knowing that my ENTIRE FUTURE in programming, i would be too scared and fail. but because im a 7th grader in a very free-flowing home-school program in which watching RUclips means my teacher is in LOVE with me, i get to pay attention, pause, play around with software in the middle of class and alot of other stuff. the only thing i dont love is that i cant ask HIM a question.
Thanks for this, everyone involved! I am currently on lecture 6 but I find it interesting how the number of views for each lecture goes down as the lecture number goes up.
Thank you. I should have remembered that from intro to Linux. I definitely remembered how important attention to detail is with Linux. This open source education is probably the greatest discovery since the internet itself.
49:21 it won't go into an infinite loop. The result will be 0 since the while loop is skipped because -4 is smaller than 0 and outputs the value of Y, which is 0.
after i watched this video Operators and operands; statements; branching, conditionals, and iteration, my insight is very open because the video is very good to give information
@13:10, when professor answers the student's question, his statement "under ASCII encoding, the numbers are going to appear after the characters (alphabets?)" is incorrect. In ASCII encoding the numbers come before the alphabets. The reason why 4 < '3' is "True" is because the value of '3' in ASCII is 50 in decimal. So (decimal 4) < (decimal 50) is True. As the professor indicated, python has an issue where it allows mixing of types and is the reason for confusions.
Adam Adam 1-how do we know when has a block ended coz at 37.12 the output said mom and not hello although both hello and mom print statements were written consecutively without anything in between. 2-the integers are not assigned to variables rather the variables just get bound to the number which pre existed somewhere then does the same hold true for strings also coz it would have had been a daunting task for the developer to create all combinations of words and sentences that can be made with 26 alphabets which can then be bound to the variables.
18:06 X does not point to the value 15 stored in memory. It is completely incorrect to imagine that x points to it. It is much more accurate to think of x as a box into which the value 15 is copied.
instead of doing str(10) with your number inside the parameters, you can also contain your number with back-ticks `10` and it will consider the number a string.
I believe the explanation that says 15 is stored in memory and three values point to it is in error. I have programmed in binary, assembler and all the way to ADA [BOO!]. I believe there are 3 variables all containing the number 15. I would be interested in heraing your response response
Thank you for the amazing lectures. In the newer version (3.6.0) to check an integer if it's even or odd I did the following: x=15 if (x%2==0): print ('Even') else: print ('Odd')
He is quite interesting teacher. Of course, lessons should be viewed several times. He is much more better that the next one, who were lazy even to learn what he is teaching (always looks to notes on next lessons). Will see, how these lessons will learn me Python.
I am going to see videos on Linear algebra by Gilbert Strang and Harvard Statistics 110 video series too during the winter break. I think these are the most important math topics for ML.
Woe this is very amazing and interesting very intricate and dyammmmm it's free this is so thuro ! This is way better teaching that I have ever had the pleasure of listening to thankyou so much for the time and generosity involved in Hosting this lecture sorry I'm babbling out of amazement.
the new IDLE has many new features that are not consistent with these lectures that might create some confusion... so guys you better watch yourselves out... for example (5/2) in the 1.4 shell version gives the number of multiples of 2 that fit in 5... in short it gives the first quotient.... but now in the latest shells, python provides the complete division like (5/2) gives 2.5.. but still these lectures are fantastic.... thanks to MIT OpenCourseWare
Exactly. They made the change one year after this lecture was made, when Python updated from version 2 to version 3. Python 3.x now returns floats instead of integers. www.informit.com/articles/article.aspx?p=1439189
Exccellent teachings professor! I love the way you rendered the "Recipe Comparison Initiative," per say...:) Nice work! I've some questions but I'll await till I get most of the videos completed in viewing then I'll kinda take it from there. Thanks so much for the videos!
the new IDLE has many new features that are not consistent with these lectures that might create some confusion... so guys you better watch yourselves out...
Great question by one of the students - i was wonder what factored in to why 'a' > 'g' returns False, it's because the ASCII code for the symbol! Lotsa good stuff in here - I might need to watch it again. First tho, maybe time to start some of the associated lesson reading materials :)
Metaphysical Axiom, it's a great means to extend your compost economy. The microbiological analysis in the manual is excellent for dialing in your application (bacterial or fungal dominance). & best of all - it's so easy: bucket of water, bubbler pump and hose (big bubbles, fine bubbles chop up the biology), a mesh bag, some good compost & voila! As for application, the pressure of a four foot drop is enough to kill up to half the biology - a gentle meditative approach is good, or, if you are irrigating, just avoid right angles in the piping and use a diaphragm pump (instead of a rotary one). Generally, if your brew is frothy & smells like rich soil, you are good to go! :-D
@krenuds the link above had the last bit of the url cut out, the full url is ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00-introduction-to-computer-science-and-programming-fall-2008/download-course-materials/ download the zip and the handouts are under each lecture. On another note, thank you MIT for this wonderful resource!!
Type discipline, that sums up why most coders, so called coders, need to take this course. It is more like a lot of bad drivers on the road with a driving license. You need to go back to basics to be reminded of the correct way of driving.
Well if u wanna specifically major in computer engineering from a 4 year university, it will require lots of math. You will be required to take calculus I, II, III, differential equations, and linear algebra. Trig is recommended to have been taken during high school, otherwise you'll do it at college and be a little behind. Engineering is a tough discipline. I'm a senior in electrical engineering, and shit aint exactly easy. If you want to complete your degree, u have to be passionate about it.
In python, whitespace is very important. Your code should look like this: x = 15 if (x/2)*2 == x: print 'even' else: print 'odd' However, if you are using python 3, print is used as a function, so you need to type print('even') instead of print 'even'.
wow, I'm sure his IDLE shell said something like version 1.4 or something Nevertheless I am finding these lectures very interesting even if they are a few years old, it is amazing that there's resources like this available, not everyone's in a position where they can actually attend a University so it is really cool to have this available. Thanks
7XCOLE for this course that is mostly irrelevant, as these fundamental computation principles have remained largely unchanged. They are still a good basis to start from learning more contemporary techniques and languages. It is not a course about Python, remember?
@32:37 why is the program returning the "odd" statement? What is happening in my mind is 15 being divided by 2 yields 7.5, and because 15 and 2 were entered as integers with no periods, the resulting "7.5" would yield only the integer "7". This is then multiplied by 2, creating an EVEN number rather than the "odd" resulting text. What am I missing here? TIA
Because if you divide 15, you get 7, next step is comparing 7*2 with the original number (15). If those two are not same, you get "ODD". Doesnt matter if the number itself is even or not.
@37studios He is using IDLE, which is an IDE (integrated development environment) that comes with Python. IDLE is doing the colors. He appears to be using Python 2.4, but IDLE comes with every version of Python.
@24:00 I slightly disagree. If you can read code anyone wrote a year after it was written and understand it clearly it is a sign of good code. There needs to be a balance on the amount of comments in code. Too many and they become like ads; no one reads them and they just clutter space. I think of comments as ways to explain intentions. Comments are also important to warn the reader. Sometimes history can be captured but that is more for business reasons; linking a change in code to documentation or a work tracking ticket. I teach my engineers these concepts: 1. Comments shouldn't explain the language. Example of bad comment: // this code multiples the 2 arguments and averages them 2. Rename something if it isn't clear. 3. Complex expressions often should be refactored into macros, functions, methods, etc. for readability. `if (((a + b) / 2) > last_average)` is worst than `if (AVERAGE(a, b) > last_average)` the first slows down the reader, second is concise. 4. Block comments should be a block and not inline. (We break this rule for comments within expressions `int func(/*enable=*/true, /*interations=*/6);`) 5. Line comments should be at the end of a statement. There are a few other rules we follow. What rules do other people follow?
In case you are using python 3, the expression: 4>> 4>'a' Traceback (most recent call last): File "", line 1, in 4>'a' TypeError: '>' not supported between instances of 'int' and 'str'
Just a note on what's going on at 33:05. It seems that division automatically returns a float in the current version of Python, 3.3. So that piece of code would always print "Even". Love the lectures btw, I'm quite hooked.
Another way of doing it besides riding on integer arithmetic (which could fall through if somehow a floating point gets assigned to a variable which will, as per python's design, dynamically change into a variable that holds floating points) would be to use the modulus operator, %. For example: if x%2==1: print 'Odd' else: print 'Even'
I just wanted to say thank you for the free lectures, however I do have a criticism. I understand this video was recorded in 2009 so maybe higher definition video camera wasn't available but taking down notes from the chalkboard or reading code on the projector is very blurry. If there is a 720p or higher version that can be uploaded I would greatly appreciate that.
Sorry but the source is in SD (standard definition), but there are handouts available for the course on MIT OpenCourseWare at ocw.mit.edu/6-00F08 under the "Related Resources" tab for each video. You might also want to checkout the Scholar version of the course which has more complete materials (online textbook, exams with solutions, assignments with solutions, etc.) at ocw.mit.edu/6-00SCS11.
Wow, the first lecture had over 5 million views while this one only has less than 1 million presently. 80% drop rate after first class is quite significant. I wonder how many finish? I wonder if I will?
@ShitWrangler It's all in what you find interesting. If this bores you, then it may not be the class for you. When I was younger, this would have bored me to tears. Now, I LOVE IT!
TrollingAround is referring to the bitwise and operator, &. if x&1: print 'Odd' else: print 'Even' He is correct in saying that it is much faster because bitwise operations are much quicker and easier to perform than regular arithmetic. @alphydan: the 'and' keyword in python refers to the logical and, not the bitwise and. In terms of booleans and integers, any non-zero value is equivalent to TRUE.
@aHbEnZhAi X is assigned to the value of 15, Y also. If you change X, you change the pointer of X to point to a new value. You do not change the value itself, so 15 is still 15, thus Y remains 15, while X has a new value.
I learned about numbers and strings this year in high school. That is about all we learned in my shitty computer science class. But college gives me hope because i dnt know most of what this guy is talking about, but I definately want to know. Hopefully my college professor will be as energetic while teaching.
Absolutely love this professor's method of teaching! It is very well explained! (As I would expect from an MIT professor.)
Also, thank you, MIT, for the free knowledge. It is very important!
Just as an FYI, these lectures feature older versions of Python, so there are a couple of differences (as far as what I can think of right now and are plausible to what he is teaching): (BTW these only apply to Python, not all programming languages; each one have their own set of syntax rules.)
- The '/' operator now provides real solutions (e.g. 9/5 is 1.8). It seems to convert the VARIABLE into float automatically - you can check that by assigning a division to a variable (as an example, [value = 9/5]) then typing the command [type(variable)] (in my case, [type(value)]) and it will give out "float".
It will not do that, however, if you use the operator "//", which is an integer division - the variable will be set as the int type (integer);
- You CANNOT compare a string with a number anymore: it now gives out the expected TypeError;
- Print statement goes with parenthesis now. Should be [print('statement')], not [print 'statement'] - it will give out SyntaxError without the parenthesis.
- 'raw_input()' has been changed to 'input()' and the original 'input()' does not exist anymore. Source with more details found on stackoverflow.
- 'while' loops do not take parenthesis anymore - they are not needed. However, no error message will be given out (taking base from Python 3.7). This also applies to 'if' statements.
Again, thank you MIT for the awesome lectures! And thank you, reader, for paying any attention to my comment! :)
Thanks Daniel for updating us with new information.
Thank you Daniel for very useful information 👍🏼
So is learning the language in this course outdated ?
@@theadel8591 TLDR: No, not at all! Most of what the course covers includes the key features newer versions still have as well.
Python is such a nice language that, while the versions are different and there are improvements/modifications, the versions are similar enough that it is still an incredible course.
However, very important to note that, depending on your usage, it is good that you learn both this version and newer ones - there are companies, as an example, that still uses Python 2 for their software.
In any case, if you learn from this course, you'll find it is way easier to learn the differences later and it will not be hard to adapt your code.
Hope this responded - if not, please comment again and I'll be sure to answer! :D
@@getellied thanks Danielle, i’m now more confident in the time and effort I’ll put into this course.
this is so cool, I am taking MIT computer science lectures for free. love this era. good class sir.
Don't be rude.
@J W Calm down.
I dreamt about studying in mit see now I'm a student of mit
@@harshvaghanii hello. Me too.
@@harshvaghanii Me too🤗
So far I've found and have taken one entire course from the University of Toronto by Dr. Jordan Peterson and now working on the Harvard CS50 and this MIT 6.00 lecture; if a person doesn't educate themselves it's due to their own choice, the resources available now are limitless. You can ask all of my notebooks, I take notes for every class and ensure a good night's sleep after that lecture and lab, so far that's been my recipe for moving data from short term to long term memory. Thank you @MIT for making these available to the public, I'm truly grateful.
how far along are you now? these videos are out of date. :(
Hey ? If you ever see that and still have them i would be happy to have your notes ! (And what about you now :)?)
did you say you have notes? and do you use anki?
Had no idea during 2009 that MIT was uploading there class lectures like this. All I did during 2009 was watching music videos in youtube.
We all did
Free education rocks!
shizyninjarocks free power
awesome but i wished they had better quality so i could read the code in full screen xD
Amar Hajdarević yes, we are, but they received a highly accredited degree.....if they passed the class, that is.
Could you pass along my thanks to the professors and whoever came up with this idea. These videos are a Godsend for someone who has to repeat segments over and over again due to an extreme case of ADHD. I could not sit through an actual class and get this without my mind wandering across any and every other possible subject.
I like how this teacher is humble enough to admit a mistake
I love these, it don't like my prof he's not very effective at teaching this stuff, i have no background in computer science and my first day my prof went into so much stuff and i have no idea what he was talking about but I'm learning alot from these videos!!
i swear this guy and john are like best friends. He refers to this guy every other minute lol
plot twist, he's his imaginary friend.
Johns like. He pays me to stay here. 😂
theyre secret lovers
Views drop off each proceeding lecture. That shows the extent to which some are willing to commit to a path.
lmao true! They can't appreciate the beauty of free education
A phenomenal discovery.. please have your findings published.
Self-discipline is no easy thing. Hard work pays off.
This happens in real life at universities also. The first lectures are a deluge of people queuing 10 minutes early, eager for those doors to open. By mid term a third of the seats are empty and people are walking in 5 and 10 minutes late.
ease off with the judgements. there could be a lot of reasons. they might have found better resources, schools, materials, etc. MIT's OCW isn't the only high quality resource available. or they could have moved to a new place where access to youtube or any OCW is restricted, they could have gotten killed etc.
one thing's for sure tho - we don't know shit about them.
Professor Grimson is an "off the hook" orator. He breaks down programming in a way that allows even the thickest of students to understand the subject matter and make educated decisions. Kudos for teaching in Python. It is a powerful language but closest to "easy" that you can get in programming. Well done, Gents. Cheers.
10:54 They seem to have taken the feedback, since in Python 3.8 this is no longer possible; it will no longer assume you want to compare the value expressed by the string if the other parameter is not also a string. In other words: If both are numbers, or if both are strings, it WILL compare their value, but if one is a number and the other a string, it will throw an error message.
No excuse for not expanding your mind nowadays.
*fixed
nowadays👍
Lol
I start college this fall and I am already being taught by an MIT professor on programming can’t get better than this.
I'm new to programmin and i felt in love with Python the second i ran it, and i never tried to program before. But it was kinda hard to find a lecture or tutorial as good as this OCW. I always dreamed of e going to MIT, but being brazilian never helped, but now i can at least have a lil taste of it.
I am in college right now and am taking this class (of course not at MIT), these videos help sooooooo much. I am glad they started this.
7:05 you get to see JOHN, OMG HE IS A ACTUAL PERSON
Somebody didn't fully watch lecture 1 ;) we saw him there too
Thank you for these VDO. It helps to undetstand more about coding and programing for me, a person does not know anything about coding,but only languages for my living. Please keep this good work on. I love this professor and his lecture.
Thank you so much uploading these lectures for free. May God bless the MIT more and more. Prof. Eric Grimson is teaching great!! Loved it !!
Excellent professor. He explains everything with precision and clarity. I wish my programming professor was like this man. If you're having trouble try Bucky's tutorials for additional clarity. Definite subscribe.
i love how he teaches some how he doesn't make the lecture boring
Most important with employers are the following: 1) Can you follow a routine for long periods of time (years) ? 2.) Can you complete a task that you've started ? 3.) Can you work under the pressure of a schedule ? 4.) Can you work within the system, as opposed to doing it your own way? 5.)How do I know, BEFORE I hire you, that you have the skills you say you have? 6.) Is there some way I can verify that your skills have been tested ? 7.)
i love this. if i were an older person taking this course and knowing that my ENTIRE FUTURE in programming, i would be too scared and fail. but because im a 7th grader in a very free-flowing home-school program in which watching RUclips means my teacher is in LOVE with me, i get to pay attention, pause, play around with software in the middle of class and alot of other stuff.
the only thing i dont love is that i cant ask HIM a question.
Thanks to the MIT, Eric and John for this excelent course.
“You blew 150k on an education you could have gotten for a $1.50 in late fees from the public library.” Good Will Hunting
@@RandomRUclips123 If everybody thought that was the sole benefit, these courses would not exist.
That Will Hunting was one of the dumbest folks ever to be seen on the silver screen.
This is awesome!!!! Learning more here than semesters in "Online Colleges" Thank you for making this available!!!!
i personally want to thank professor jim ericson for delivery such interesting lectures
Your tutorials are absolutely excellent for beginners.
Thanks for this, everyone involved! I am currently on lecture 6 but I find it interesting how the number of views for each lecture goes down as the lecture number goes up.
Thank you. I should have remembered that from intro to Linux. I definitely remembered how important attention to detail is with Linux.
This open source education is probably the greatest discovery since the internet itself.
49:21 it won't go into an infinite loop. The result will be 0 since the while loop is skipped because -4 is smaller than 0 and outputs the value of Y, which is 0.
He has such a great way about laying things out logically so they are easy to understand.
Props to MIT for making this free. All human knowledge should be free.
after i watched this video Operators and operands; statements; branching, conditionals, and iteration, my insight is very open because the video is very good to give information
great opportunity to watch fascinating lectures from a prestigious university.
@13:10, when professor answers the student's question, his statement "under ASCII encoding, the numbers are going to appear after the characters (alphabets?)" is incorrect. In ASCII encoding the numbers come before the alphabets. The reason why 4 < '3' is "True" is because the value of '3' in ASCII is 50 in decimal. So (decimal 4) < (decimal 50) is True. As the professor indicated, python has an issue where it allows mixing of types and is the reason for confusions.
Adam Adam 1-how do we know when has a block ended coz at 37.12 the output said mom and not hello although both hello and mom print statements were written consecutively without anything in between.
2-the integers are not assigned to variables rather the variables just get bound to the number which pre existed somewhere then does the same hold true for strings also coz it would have had been a daunting task for the developer to create all combinations of words and sentences that can be made with 26 alphabets which can then be bound to the variables.
18:06 X does not point to the value 15 stored in memory. It is completely incorrect to imagine that x points to it. It is much more accurate to think of x as a box into which the value 15 is copied.
Loving these lectures and learning so much, like Eric says "while" like his safe word is whiskey in Hot Rod.
instead of doing str(10) with your number inside the parameters, you can also contain your number with back-ticks `10` and it will consider the number a string.
I was giving myself candy every time he asked a question and I was able to answer it. Hersey's kisses with almonds to be clear.
lol
no almonds!!!
I'm stealing your idea only using popcorn. White cheddar to be clear.
Had to say thank you for these. They've been priceless to me.
Thank you, Prof. Grimson and MIT for a great video.
I am enjoying these videos, they are a great way to learn more besides what I study already, goes great with what we are learning in my class
I believe the explanation that says 15 is stored in memory and three values point to it is in error. I have programmed in binary, assembler and all the way to ADA [BOO!].
I believe there are 3 variables all containing the number 15. I would be interested in heraing your response response
Thank you for the amazing lectures.
In the newer version (3.6.0) to check an integer if it's even or odd I did the following:
x=15
if (x%2==0):
print ('Even')
else: print ('Odd')
So true.
I did it like in the video and I got even has result .. so i believe doesn't work the same way on newer versions o python
Thank you. I was really scratching my head over this since (x/2) * 2 can work for both odd and even numbers.
Thanks Goodness for the subtitles, they really help. :)
He is quite interesting teacher. Of course, lessons should be viewed several times. He is much more better that the next one, who were lazy even to learn what he is teaching (always looks to notes on next lessons). Will see, how these lessons will learn me Python.
thank you for this MIT. Big kudos to you
2/24 . Let's see how far I can go :P . Learning this to study Machine Learning.
great, going to learn machine learning myself too! But isn't maths more important for that purpose? I am not sure
I am going to see videos on Linear algebra by Gilbert Strang and Harvard Statistics 110 video series too during the winter break. I think these are the most important math topics for ML.
How is the Machine Learning learning(lol) going?
so did it happen?
@Aditya how far along are you now?
Yes, in Python 3.x it is flipped, to get 3/5 = 0 in Python 3, you have to use double forwards slash: Python 3: 3//5 = 0, Python 2: 3/5 = 0
definitely love his classes... How i hope i get to see whats in their handout
Woe this is very amazing and interesting very intricate and dyammmmm it's free this is so thuro ! This is way better teaching that I have ever had the pleasure of listening to thankyou so much for the time and generosity involved in Hosting this lecture sorry I'm babbling out of amazement.
the new IDLE has many new features that are not consistent with these lectures that might create some confusion... so guys you better watch yourselves out... for example (5/2) in the 1.4 shell version gives the number of multiples of 2 that fit in 5... in short it gives the first quotient.... but now in the latest shells, python provides the complete division like (5/2) gives 2.5.. but still these lectures are fantastic.... thanks to MIT OpenCourseWare
Exactly. They made the change one year after this lecture was made, when Python updated from version 2 to version 3. Python 3.x now returns floats instead of integers.
www.informit.com/articles/article.aspx?p=1439189
It's so sweet how he throws out candy. I bet it encourages class participation!
Indeed an Awesome Lecture just like we had at Berkeley from Prof. Cummings!
All the reading im doing is not really helping but these videos are gold! thanks guys
Exccellent teachings professor! I love the way you rendered the "Recipe Comparison Initiative," per say...:) Nice work! I've some questions but I'll await till I get most of the videos completed in viewing then I'll kinda take it from there. Thanks so much for the videos!
python now correctly throws an error if comparing string to int:
print('a'
i wonder how they achieved this. did they change the function of
The video was made 8years ago which mean python 3.5 was not in existence then. you can download 2.7 to get a taste of the execution.
the new IDLE has many new features that are not consistent with these lectures that might create some confusion... so guys you better watch yourselves out...
+Jonnie Poole they simply instructed the program to show an error
The (x/2)*2 way of checking odd or even wont work out either in python 3. It automatically converts it to float while dividing.
In python, each indentation is 4 spaces. Sometimes tab can give you more or less than that. Try indenting 4 spaces.
YaY - the video projection of the mac screen output shows up great!
Thanks MIT - this lectures series is fantastic!
Great question by one of the students - i was wonder what factored in to why 'a' > 'g' returns False, it's because the ASCII code for the symbol!
Lotsa good stuff in here - I might need to watch it again. First tho, maybe time to start some of the associated lesson reading materials :)
Hi Metaphysical Axiom,
If you dig permaculture, are you familiar with the work of Dr. Elaine Ingham? She's awesome!
Metaphysical Axiom,
Here ya go:
www.nofanj.org/LiteratureRetrieve.aspx?ID=104151
Metaphysical Axiom, it's a great means to extend your compost economy. The microbiological analysis in the manual is excellent for dialing in your application (bacterial or fungal dominance). & best of all - it's so easy: bucket of water, bubbler pump and hose (big bubbles, fine bubbles chop up the biology), a mesh bag, some good compost & voila! As for application, the pressure of a four foot drop is enough to kill up to half the biology - a gentle meditative approach is good, or, if you are irrigating, just avoid right angles in the piping and use a diaphragm pump (instead of a rotary one). Generally, if your brew is frothy & smells like rich soil, you are good to go!
:-D
Note to self:
en.wikibooks.org/wiki/Python_Programming
Rumour has it that John is a legend
@krenuds the link above had the last bit of the url cut out, the full url is
ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00-introduction-to-computer-science-and-programming-fall-2008/download-course-materials/
download the zip and the handouts are under each lecture.
On another note, thank you MIT for this wonderful resource!!
Type discipline, that sums up why most coders, so called coders, need to take this course. It is more like a lot of bad drivers on the road with a driving license. You need to go back to basics to be reminded of the correct way of driving.
These lectures are really very good!
RIP to the several million people who didn't make it to lecture 2
Well if u wanna specifically major in computer engineering from a 4 year university, it will require lots of math. You will be required to take calculus I, II, III, differential equations, and linear algebra. Trig is recommended to have been taken during high school, otherwise you'll do it at college and be a little behind. Engineering is a tough discipline. I'm a senior in electrical engineering, and shit aint exactly easy. If you want to complete your degree, u have to be passionate about it.
Kudos to MIT for this course!
To everyone using python 3.0 and up, the even trick no longer works, as you no longer require floating integers to not do integer division.
In python, whitespace is very important. Your code should look like this:
x = 15
if (x/2)*2 == x:
print 'even'
else:
print 'odd'
However, if you are using python 3, print is used as a function, so you need to type print('even') instead of print 'even'.
Opps! I m a person who does not know anything about coding and programing. I love his lectures. :-)
wow, I'm sure his IDLE shell said something like version 1.4 or something
Nevertheless I am finding these lectures very interesting even if they are a few years old, it is amazing that there's resources like this available, not everyone's in a position where they can actually attend a University so it is really cool to have this available.
Thanks
Yeah, wish they could have some updated versions as we all know how fast computers are evolving, but good nevertheless.
7XCOLE for this course that is mostly irrelevant, as these fundamental computation principles have remained largely unchanged. They are still a good basis to start from learning more contemporary techniques and languages. It is not a course about Python, remember?
Ben W even University don't teach for beginners it wasn't a fun experience
@32:37 why is the program returning the "odd" statement?
What is happening in my mind is 15 being divided by 2 yields 7.5, and because 15 and 2 were entered as integers with no periods, the resulting "7.5" would yield only the integer "7". This is then multiplied by 2, creating an EVEN number rather than the "odd" resulting text.
What am I missing here? TIA
Because if you divide 15, you get 7, next step is comparing 7*2 with the original number (15). If those two are not same, you get "ODD". Doesnt matter if the number itself is even or not.
In new Versions of python 'a'
Branching section starts at 29:10.
@37studios He is using IDLE, which is an IDE (integrated development environment) that comes with Python. IDLE is doing the colors. He appears to be using Python 2.4, but IDLE comes with every version of Python.
UM... Wow! This is some sweet stuff right here... I cant believe I'm sitting in on an MIT CS lecture!!! AWEsOME!
On a second note these videos are awesome! Thank You!
It helps if you save the program with a ".py" it keeps your words highlighted
@24:00 I slightly disagree. If you can read code anyone wrote a year after it was written and understand it clearly it is a sign of good code. There needs to be a balance on the amount of comments in code. Too many and they become like ads; no one reads them and they just clutter space.
I think of comments as ways to explain intentions. Comments are also important to warn the reader. Sometimes history can be captured but that is more for business reasons; linking a change in code to documentation or a work tracking ticket.
I teach my engineers these concepts:
1. Comments shouldn't explain the language. Example of bad comment: // this code multiples the 2 arguments and averages them
2. Rename something if it isn't clear.
3. Complex expressions often should be refactored into macros, functions, methods, etc. for readability. `if (((a + b) / 2) > last_average)` is worst than `if (AVERAGE(a, b) > last_average)` the first slows down the reader, second is concise.
4. Block comments should be a block and not inline. (We break this rule for comments within expressions `int func(/*enable=*/true, /*interations=*/6);`)
5. Line comments should be at the end of a statement.
There are a few other rules we follow.
What rules do other people follow?
In case you are using python 3, the expression:
4>> 4>'a'
Traceback (most recent call last):
File "", line 1, in
4>'a'
TypeError: '>' not supported between instances of 'int' and 'str'
Great videos for learning Python syntax. I like how the developers force you into a structured coding environment. :-)
Awesome lecture. Detailed instructions followed by solid examples.
👍👍👍
Just a note on what's going on at 33:05.
It seems that division automatically returns a float in the current version of Python, 3.3.
So that piece of code would always print "Even".
Love the lectures btw, I'm quite hooked.
Python made a long way since this MIT class but there is still lots of useful information.
Thank You for This quality Free education content, very much perseverated !
Again really appreciate the lectures.. guys much appreciated
Another way of doing it besides riding on integer arithmetic (which could fall through if somehow a floating point gets assigned to a variable which will, as per python's design, dynamically change into a variable that holds floating points) would be to use the modulus operator, %.
For example:
if x%2==1: print 'Odd'
else: print 'Even'
I just wanted to say thank you for the free lectures, however I do have a criticism. I understand this video was recorded in 2009 so maybe higher definition video camera wasn't available but taking down notes from the chalkboard or reading code on the projector is very blurry. If there is a 720p or higher version that can be uploaded I would greatly appreciate that.
Sorry but the source is in SD (standard definition), but there are handouts available for the course on MIT OpenCourseWare at ocw.mit.edu/6-00F08 under the "Related Resources" tab for each video. You might also want to checkout the Scholar version of the course which has more complete materials (online textbook, exams with solutions, assignments with solutions, etc.) at ocw.mit.edu/6-00SCS11.
Thank you for the prompt reply and helpful information. :)
really complicated but after a bit of research i understand more, what an excellent educational video, thanks +MIT OpenCourseWare
It becomes way more complicated. Good luck.
I really love programming, its like art for smart people! (not saying that artists are stupid)
Excellent material. Someone needs to get this man a keyboard and mouse.
thats because = is an assignment operator and == is relational operator...to compare two values, relational operators are used
Wow, the first lecture had over 5 million views while this one only has less than 1 million presently.
80% drop rate after first class is quite significant. I wonder how many finish?
I wonder if I will?
In python 3.5 te expression 'a' < 3 is type-checked and pops the TypeError: unorderable types: str() < int()
@ShitWrangler It's all in what you find interesting. If this bores you, then it may not be the class for you. When I was younger, this would have bored me to tears. Now, I LOVE IT!
TrollingAround is referring to the bitwise and operator, &.
if x&1: print 'Odd'
else: print 'Even'
He is correct in saying that it is much faster because bitwise operations are much quicker and easier to perform than regular arithmetic.
@alphydan:
the 'and' keyword in python refers to the logical and, not the bitwise and. In terms of booleans and integers, any non-zero value is equivalent to TRUE.
when I saw it first I was really surprised beacuse it is a very good oportunitiy for the person who wants to improve himself
@aHbEnZhAi X is assigned to the value of 15, Y also. If you change X, you change the pointer of X to point to a new value. You do not change the value itself, so 15 is still 15, thus Y remains 15, while X has a new value.
>>> 'a' < 3
Traceback (most recent call last):
File "", line 1, in
'a' < 3
TypeError: '
I learned about numbers and strings this year in high school. That is about all we learned in my shitty computer science class. But college gives me hope because i dnt know most of what this guy is talking about, but I definately want to know. Hopefully my college professor will be as energetic while teaching.