loops/questions.rst
changeset 468 ac1198488c0e
parent 462 3a1575a45152
--- a/loops/questions.rst	Thu Nov 11 13:21:10 2010 +0530
+++ b/loops/questions.rst	Thu Nov 11 17:28:23 2010 +0530
@@ -15,9 +15,10 @@
    #. tuples
    #. all of the above
 
-.. I was not sure of how to frame this question. Can someone fix it?
+   Answer: all of the above
 
-   Answer: all of the above
+.. I was not sure of how to frame this question. Can someone fix it?
+.. #[bhanu: it works for every `sequence` or an iterator for that matter right?]
 
 #. ``x = range(20)``. What is x?
 
@@ -85,7 +86,7 @@
 
    Answer: Nothing is printed
 
-.. #[[Anoop: I think more questions on while loop has to be added as
+.. #[[Anoop: I think more questions on while loop have to be added as
    for loop was already covered in another LO, these questions can be
    kept, but it will good if we add few more on while loop]]
 
@@ -95,4 +96,7 @@
 1. A number is called Armstrong number if the sum of cubes of its digits is
    equal to the number itself. Find all the three digit Armstrong numbers.
 
-.. #[[Anoop: Add one more question]]
+2. Collatz sequence - Given a number ``n``, multiply by 3 and add 1 to
+   it, if it is odd, otherwise divide it by two. With whatever ``n``
+   we start with, we finally end with the sequence 4, 2, 1. Write a
+   program to print this, given some number ``n``.