Lec 3 | MIT 6.00 Introduction to Computer Science and Programming, Fall 2008
Tagged on:                                                                                                         

100 thoughts on “Lec 3 | MIT 6.00 Introduction to Computer Science and Programming, Fall 2008

  • April 9, 2013 at 2:41 pm
    Permalink

    I could watch it before,but now?

    Do I have to donate the money first to watch it again ?

    Reply
  • April 12, 2013 at 12:14 am
    Permalink

    Agreed. He stated in the first video that this is not a course on Python. He's using the language to illustrate important concepts in computer programming and he clearly knows quite a bit about those.

    Reply
  • April 12, 2013 at 2:51 am
    Permalink

    This is how some professors learn as their going. He's probably taught this very same course using several different languages in the past.

    Reply
  • April 13, 2013 at 1:09 am
    Permalink

    You are quite correct. I spotted that mistake as well. The condition should check if ans times ans is less than x (ans * ans < x) instead of if ans times ans is less than or equal to x (ans * ans <= x).

    I believe this type of mistake is pretty common, even among seasoned programmers. This is why it's important to test every piece of code as it's added to a script.

    Reply
  • April 13, 2013 at 1:17 am
    Permalink

    Actually, he purposely made that mistake to illustrate a point 18:25

    Reply
  • April 30, 2013 at 10:41 am
    Permalink

    It is possible to get the Homework assignments?

    Reply
  • May 8, 2013 at 12:21 pm
    Permalink

    ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00-introduction-to-computer-science-and-programming-fall-2008/assignments/

    Reply
  • June 8, 2013 at 11:25 am
    Permalink

    "So what have we actually done over the last few lectures?"
    Well according to this video, you've caused about 1.3 million people to get confused and give up!

    Reply
  • June 19, 2013 at 11:58 pm
    Permalink

    endless loop

    Reply
  • June 28, 2013 at 2:31 pm
    Permalink

    Exactly what I thought when he was talking about Bush's earlier in the series.

    Reply
  • July 2, 2013 at 10:44 pm
    Permalink

    divisors = divisors + (i,)
    put a comma after i.

    Reply
  • July 14, 2013 at 6:05 am
    Permalink

    After less than two weeks worth of the lectures, this series has already surpassed what I learned when I audited a course at my local community college. This is why MIT is MIT, THANK YOU for making this available!

    Reply
  • July 15, 2013 at 4:39 pm
    Permalink

    Thanks for these lectures!!! Amazing!!!

    Reply
  • July 21, 2013 at 9:40 pm
    Permalink

    well said

    Reply
  • July 30, 2013 at 4:51 pm
    Permalink

    Would it be better practice to use an equation to find, say, an even number instead of iterating to that number? Will it be important in a long term project to use the least amount of iterations as possible or can the resources of modern day computers withhold iterations to the point we don't have to worry about it? I'm just wondering if using iterations when it is not necessary is bad practice. Even though without iterations we cannot collect each number..help? 🙂

    Reply
  • August 11, 2013 at 11:19 pm
    Permalink

    Are we supposed to understand how to read and write basic codes after the past 3 lectures. if so im behind :/

    Reply
  • August 12, 2013 at 6:59 am
    Permalink

    The last example?
    Answer 17?
    17 digits? I don't get it. 1952 is a 4 digit number right?

    could someone explain this to me?
    thank you sooo much in advance.

    Reply
  • August 12, 2013 at 7:12 am
    Permalink

    oh, never mind, I got it. The sum OF the digits, not the # of digits.

    Reply
  • August 12, 2013 at 7:14 am
    Permalink

    But what WOULD the code look like to add up the # of digits? (that's what I was trying to do)

    Reply
  • August 13, 2013 at 2:33 pm
    Permalink

    too complex i don't understand how the answer is 17 at the end

    Reply
  • August 13, 2013 at 2:45 pm
    Permalink

    oh ok i understand how the code get 17 now.

    Reply
  • August 13, 2013 at 3:51 pm
    Permalink

    Wherr can I find problem sets?

    Reply
  • August 19, 2013 at 5:24 pm
    Permalink

    Yes you should be able to read and write basic codes after the past 3 lectures, however, you have to remember that the students are working 9-10 hours each week on problem sets and homework in addition to their recitation (where they can ask and receive answers to questions that weren't necessarily covered in the lecture or require clarification). So, unless you have been following the exact curriculum as the students, you will naturally be a bit behind.

    Reply
  • August 19, 2013 at 5:28 pm
    Permalink

    It's also worth mentioning that these MIT students are at MIT because they overachieve and work very hard (of course some are naturally bright without effort but I would bet that a majority are a product of consistent hard-work) so it is very likely they are in fact a few chapters ahead of the lectures (in addition to the problem sets/homework I mentioned in the previous comment). Just keep practicing, thinking and find literature you can read along with.

    Reply
  • August 20, 2013 at 3:00 am
    Permalink

    To do this, you'd use a method in Python.

    x = '1952'
    print len(x)

    When run, it gives you 4.

    Reply
  • August 20, 2013 at 3:05 am
    Permalink

    You only will understand the fundamental building blocks for writing code. The professor has introduced all the building blocks, but don't worry, you'll get there. Just practice.

    Reply
  • August 29, 2013 at 5:14 am
    Permalink

    Watching these lectures is interesting, until I go to my class and they go over the exact same things

    Reply
  • September 3, 2013 at 3:39 am
    Permalink

    I'm amazed that people pay to attend MIT when these exact same topics can be learned for next to nothing. Seriously?!?! Parents are paying for some blowhard to teach PYTHON at MIT? Colleges are becoming laughable.

    Reply
  • September 5, 2013 at 1:48 pm
    Permalink

    a diploma from MIT can get you a job anywhere you want.

    Reply
  • September 17, 2013 at 2:29 pm
    Permalink

    You could either manually add up each individual integer of the numbers, which would take a while or write a for loop script where 1952 are all individual numbers in a list.

    Reply
  • September 24, 2013 at 4:11 am
    Permalink

    Thanks, I will learn from deacgrad86, if you have a question just ask this person

    Reply
  • September 29, 2013 at 3:47 am
    Permalink

    Good theory…need to do the homework and have a reason to learn it.

    Reply
  • October 19, 2013 at 6:33 pm
    Permalink

    This is an intro class

    Reply
  • October 20, 2013 at 8:00 am
    Permalink

    He has awesome humor, what's wrong with the students over there? 😀

    Reply
  • October 21, 2013 at 2:28 am
    Permalink

    from the drop down menu under view… IDE Windows…Debug Windows… Navigate

    Reply
  • October 21, 2013 at 1:27 pm
    Permalink

    go file and open new window
    save as xxxx.py
    then start to write your code on the new opened window.

    In python 3.3 version print works when it is written like this:
    print('——–') or print("——-")

    Reply
  • November 27, 2013 at 4:42 pm
    Permalink

    Unbeliveable! On the 13 min I beared to watch I found 2 errors! He proposes to do a fluxogram of a square root but he does de test ans * ans <= X instead ans * ans < X as stop condition! Not only that, if he is explaining basics why he does not initializes the variable X!!!  Is it me or MIT quality??

    Reply
  • December 24, 2013 at 4:27 pm
    Permalink

    When i starting watching these videos I said, "Boy, understanding these will be painful" but these proffesors make it easy and simple. Good job MIT 😀

    Reply
  • December 28, 2013 at 8:06 pm
    Permalink

    At one point in the video, Prof. Grimson says that the square root program is a "linear" program. This is not correct. If we start out with a number like 16, it takes ~ 4 steps to find it. If we multiply that number by 4 – i.e. 16*4 = 64 – then a linear program would take ~ 4*4 = 16 steps to find it. However, it really only takes ~ 8 steps to find it. Or, ~ 4 * √4. Because the program only has to look at all the numbers less than or equal to the square root of our input, it is an O(√n) time algorithm. That is, as the size of the input increases, the time of the algorithm increases relative to the square root of the input.

    Reply
  • December 28, 2013 at 8:11 pm
    Permalink

    Another small note for any Python beginners watching:

    Throughout the video he writes things like

    'divisor ', i

    where there is a space after the word divisor. This is redundant because in Python, spaces are added automatically between comma-delimited arguments. In other words, something like 'hello','there' will print out as 'hello there'. If instead he was using the concatenation operator, +, then the extra spaces would be necessary. Then he would write something like

    'divisor ' + i

    to get the correctly-formatted output.

    Reply
  • January 4, 2014 at 6:28 pm
    Permalink

    24:30, shouldn't the second "if" and "else" statements be indented after the "while" statement so that we are sure 'ans * ans', is not greater than 'x'?

    Reply
  • March 30, 2014 at 11:04 pm
    Permalink

    i don't have the area that he writes his code in … i write and execute in the same time in straight line !!

    Reply
  • April 7, 2014 at 9:08 pm
    Permalink

    I don't get the code and correction happening just after the 43 min. mark. I tried to run it but it returns no values. This is the bit of code that ends by saying "divisors = divisors + (i,)." What is going on here?

    Reply
  • May 18, 2014 at 2:27 am
    Permalink

    Noticing how much lower the views are from the beginning… That's just sad.

    Reply
  • May 22, 2014 at 7:07 pm
    Permalink

    Seems the learning curve is longer or impossible without a tutor.

    Reply
  • June 18, 2014 at 6:40 pm
    Permalink

    These videos are extremely helpful…
    I'm trying to gain as much knowledge as I can before I begin taking classes this fall for network management…
    I'm very interested in programming.
    This is a great starting point tool.

    Reply
  • June 19, 2014 at 3:06 am
    Permalink

    When the lecturer wrote on the board, i feel an urge inside me to take notes. But lol i am watching this video with my sleepy eyes, sitting on the bed. i hope i can restart learning programming after these 12 lessons.

    Reply
  • July 8, 2014 at 10:02 pm
    Permalink

    Those latecomers at 1:20 will be forever immortalized by M.I.T. as latecomers. You want a job at Google?? I don't think so M.I.T. research shows that you come in late!

    Reply
  • July 27, 2014 at 7:34 pm
    Permalink

    Does the other professor do anything in these lectures? If not,  why is he there?

    Reply
  • August 21, 2014 at 8:47 am
    Permalink

    where can i obtain python? please someone help

    Reply
  • September 13, 2014 at 8:09 pm
    Permalink

    I HATE the way this dude writes.

    Reply
  • September 16, 2014 at 9:16 pm
    Permalink

    30:20 ; 33:00

    Reply
  • October 23, 2014 at 8:24 pm
    Permalink

    the camera guy wasn´t learning at all

    Reply
  • December 5, 2014 at 3:26 am
    Permalink

    I'm planning on watching this entire series, and unfortuately I've found myself screaming at the screen, only to have a student correct the professor 10 seconds later. Considering the material will only get more difficult and errors, less easily caught. Does MIT provide some sort of errata for these lectures?

    Reply
  • January 3, 2015 at 1:15 am
    Permalink

    I tried the code used in 42:48 of the video and apparently python doesn't accept the line. How else can we collect the intermediate values instead?

    divisors=divisors + (i) 

    When I run the code, it showed me this.

    TypeError: can only concatenate tuple (not "int") to tuple

    Reply
  • February 24, 2015 at 9:43 pm
    Permalink

    9:57 Demon Cam

    Reply
  • March 16, 2015 at 1:14 pm
    Permalink

    Adjustment for the code:
    divisors = divisors + (i,)
    it won`t work unless you type the "," after the variable for the new Python

    Reply
  • June 7, 2015 at 9:24 pm
    Permalink

    How does he remove comments(#) so quickly?  Is he highlighting and hitting a specific letter?

    Reply
  • July 29, 2015 at 7:54 pm
    Permalink

    "…the main thing to keep in mind is the general principle that people are dumb and will make mistakes"
    -Prof. Guttag

    Heh. Indeed! Another great lecture. Some great points on style and defensive programming – thanks again MIT!

    Reply
  • September 7, 2015 at 3:10 am
    Permalink

    I'm sorry but the comment on keeping nerds in a museum had me cracking up .. Keep em coming!!

    Reply
  • September 10, 2015 at 8:56 pm
    Permalink

    Thanks for your videos!!! Could please help to find homework assignments and exercises concerning the topic. Thanks!

    Reply
  • December 7, 2015 at 1:46 am
    Permalink

    Since when is 10 not a divisor of 10?
    that "range" thing calling all up to, but not including x, could bite you in the behind if used elsewhere 🙂

    Reply
  • March 10, 2016 at 3:32 am
    Permalink

    what is he passing out to the student who answer his questions?

    Reply
  • March 18, 2016 at 6:21 pm
    Permalink

    For freeeeeeeeeeeeeeeeeeeeeeeeeee

    Reply
  • April 10, 2016 at 11:38 am
    Permalink

    which version of python is prof. using

    Reply
  • July 1, 2016 at 12:24 am
    Permalink

    Does the Introduction to Computer Science and Programming Using Python
    6.00.1x series that starts August 31, 2016 use Python 3.5?

    Reply
  • September 15, 2016 at 5:35 am
    Permalink

    hahah John is alive. Prof Eric thanks for such a great class not bad for a couple years old .

    Reply
  • September 19, 2016 at 5:07 am
    Permalink

    Such a great professor, the students are shit lol they have no emotion!!!

    Reply
  • September 30, 2016 at 11:46 am
    Permalink

    I've done notes(mind map) on 1 to 3 lessons, maybe someone find it useful.
    File gif(100kB, 2738×1197) https://1drv.ms/i/s!ArdAwIvPYluucGWDug2zDMZsXic

    Reply
  • October 3, 2016 at 3:47 pm
    Permalink

    I am in my first year of high school and I am very interested into getting into MIT. What can I do to increase my chances? I get all A's and planning on taking AP Computer Science and most other classes Honors or AP. What else can I do?

    Reply
  • October 3, 2016 at 9:59 pm
    Permalink

    Love the lecture very wonderful

    Reply
  • October 30, 2016 at 5:03 am
    Permalink

    3/24

    Reply
  • December 4, 2016 at 3:42 am
    Permalink

    my son is 10 years old and he wants to learn coding, what is the best way /course for his age?

    Reply
  • January 21, 2017 at 3:05 am
    Permalink

    Trump 2017 wooot!!!!!!!!!!!!!

    Reply
  • March 14, 2017 at 3:58 am
    Permalink

    Problem set 1a is hard, geez.

    Reply
  • April 1, 2017 at 10:01 am
    Permalink

    Thank you for your helpful and charming lecture.

    Reply
  • April 2, 2017 at 11:11 pm
    Permalink

    What on earth is going on from 47:45? What does c mean in the for loop? I have watched over and over at least 10 times and can't figure out what is going on. I understand the overall concept, which is to get the sum of the numbers, but i can't understand the method behind it. I can't understand how the answer comes about. I understand type conversion but get completely lost at 48:30. It just makes no sense. Thanks in advance…

    Reply
  • May 28, 2017 at 3:14 am
    Permalink

    As the lectures progress the view count slowly decreases… The 1st was view by 3.5 million times and it's down to 346 thousands views…

    Reply
  • June 15, 2017 at 8:59 am
    Permalink

    I wrote a program to check whether a number is prime or composite. I got this error "for i in range(1,x):
    TypeError: range() integer end argument expected, got str."
    Can someone help me please ??
    My code is as follows:
    x=raw_input('enter any number')
    k=0
    for i in range(1,x):
    if x%i==0:
    k=k+1

    if k==2:
    print'The number is prime'
    else : print 'The number is composite'

    Reply
  • July 17, 2017 at 3:31 pm
    Permalink

    It's very useful, I like this course very much.

    Reply
  • July 27, 2017 at 5:48 pm
    Permalink

    this guy is awesome

    Reply
  • October 23, 2017 at 10:03 pm
    Permalink

    25:14 John appears

    Reply
  • December 28, 2017 at 8:50 pm
    Permalink

    Bad Camera Man 🙁

    Reply
  • February 25, 2018 at 3:54 pm
    Permalink

    Please explain 18:46

    Reply
  • April 10, 2018 at 7:22 am
    Permalink

    27:00

    Reply
  • May 19, 2018 at 6:15 pm
    Permalink

    I have no real coding experience and am having quite a hard time following this, not sure if it's a sign coding isn't for me or just that this course isnt intended for someone with literally zero experience.

    Reply
  • June 30, 2018 at 2:46 pm
    Permalink

    Which programming language was being used for this course?

    Reply
  • July 9, 2018 at 4:13 am
    Permalink

    so s1 and s2 is a string or tuple?

    Reply
  • August 11, 2018 at 10:52 pm
    Permalink

    I have tried learning programming 4 times in the past. It FINALLY clicked! Thank you!

    Reply
  • August 23, 2018 at 2:31 pm
    Permalink

    25:14 john talks

    Reply
  • September 30, 2018 at 7:18 pm
    Permalink

    Can I find anywhere problem sets/assignments related to this course? Thanks

    Reply
  • October 9, 2018 at 6:25 am
    Permalink

    I believe these same courses are offered in a workabl form via edx.org. Look for MITX CS 50 i believe its called. there is 2 different courses. This is part 1 of 2. This is how i learned how to code in python. Very good courses. Really get your mind thinking in a programmatic way as opposed to some of the other introductory options out there.

    Reply
  • October 17, 2018 at 4:27 am
    Permalink

    Do they still use chalks in 2018 ?

    Reply
  • December 2, 2018 at 6:38 pm
    Permalink

    bad teacher.

    Reply
  • January 14, 2019 at 12:39 pm
    Permalink

    who's watching this while taking notes?

    Reply
  • January 26, 2019 at 8:28 pm
    Permalink

    Thanks to MIT for this great content! However I'd like to just point out that Professor Grimson makes several politically-biased remarks throughout the lecture, and to me it seems inappropriate for a course on computer science to include political remarks, even if in jest. This gives further credence to the criticism that higher learning institutions are dominated by progressive partisans.

    Reply
  • February 1, 2019 at 7:57 pm
    Permalink

    'aaah' I need the loop someway to walk in through them : Great job I always wanted to understand the theory under the surface

    Reply
  • February 27, 2019 at 10:29 pm
    Permalink

    Is John a real person?

    Reply
  • July 30, 2019 at 10:29 am
    Permalink

    Nice sir. .

    Reply
  • September 15, 2019 at 10:17 pm
    Permalink

    I've spent the past 3 hours watching 3 of the lectures. And still not bored.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *