In-Class Questions and Video Solutions

Lecture 3

  1. String Manipulations

    What does the code below print?

    s = "6.00 is 6.0001 and 6.0002"
    

     260000  close
     26100  close
     26 100  check
     nothing, it will give an error  close
     6.00 is 6.0001 and 6.0002  close
    Check Show Solution

  2. For Loops with Strings

    How many times will the code below print “common letter”?

    s1 = "mit u rock"
    

     0  close
     2  close
     4  close
     5  close
     6  close
     7  check
     8  close
     10  close
    Check Show Solution

Course Info

Learning Resource Types

assignment Problem Sets
notes Lecture Notes
theaters Lecture Videos
assignment_turned_in Programming Assignments with Examples