# HG changeset patch # User Nishanth # Date 1286817261 -19800 # Node ID 027870d8bae4c4aac93cb9e4cbefde4c7cba03a8 # Parent 290f3e62dc4463820ad5b3565994c5b73f903571# Parent c924eaf1b355e669da8630a8d025e62ed8445e49 merged diff -r 290f3e62dc44 -r 027870d8bae4 advanced-features-functions/questions.rst --- a/advanced-features-functions/questions.rst Mon Oct 11 20:20:29 2010 +0530 +++ b/advanced-features-functions/questions.rst Mon Oct 11 22:44:21 2010 +0530 @@ -17,6 +17,9 @@ #. only keyword arguments can be in any order, but should be called at the end. + Answer: only keyword arguments can be in any order, but should be called + at the end. + #. Given the following function, identify the keywords with default values. :: @@ -101,8 +104,6 @@ Larger Questions ---------------- -.. A minimum of 2 questions here (along with answers) - 1. 2. diff -r 290f3e62dc44 -r 027870d8bae4 getting-started-files/questions.rst --- a/getting-started-files/questions.rst Mon Oct 11 20:20:29 2010 +0530 +++ b/getting-started-files/questions.rst Mon Oct 11 22:44:21 2010 +0530 @@ -37,7 +37,7 @@ What is the value of content, at the end of this code block:: f = open('hello.txt') - content = f.read() + pre_content = f.read() content = f.read() f.close() @@ -126,7 +126,7 @@ .. A minimum of 2 questions here. -1. f.read(size) +1. What does ``f.read(size)`` do? #. Print every alternate line of a file, starting at the first line. diff -r 290f3e62dc44 -r 027870d8bae4 loading-data-from-files/questions.rst --- a/loading-data-from-files/questions.rst Mon Oct 11 20:20:29 2010 +0530 +++ b/loading-data-from-files/questions.rst Mon Oct 11 22:44:21 2010 +0530 @@ -56,8 +56,12 @@ 1. What will happen if one of the cells is empty? -#. Read a column with text? - #. Given a file with 3 columns of data but two different delimiters, what do you think will happen? +#. Read a column with text? + +#. An input file contains 5 columns of data. Use only the second and fourth + columns of data and load into two different variables. + [hint: read the documentation, use the argument ``usecols``] + diff -r 290f3e62dc44 -r 027870d8bae4 loops/questions.rst --- a/loops/questions.rst Mon Oct 11 20:20:29 2010 +0530 +++ b/loops/questions.rst Mon Oct 11 22:44:21 2010 +0530 @@ -71,12 +71,6 @@ Answer:: - 1 - 2 - 3 - 2 - 4 - 6 3 6 9 @@ -94,5 +88,6 @@ Larger Questions ---------------- -.. A minimum of 2 questions here. +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. diff -r 290f3e62dc44 -r 027870d8bae4 manipulating-strings/questions.rst --- a/manipulating-strings/questions.rst Mon Oct 11 20:20:29 2010 +0530 +++ b/manipulating-strings/questions.rst Mon Oct 11 22:44:21 2010 +0530 @@ -47,11 +47,11 @@ #. Given a line from a CSV file (comma separated values), convert it to a space separated line. - Answer: line.replace(',' ' ') + Answer: line.replace(',', ' ') -#. Given the string "F.R.I.E.N.D.S" in s, obtain the friends. +#. Given the string "F.R.I.E.N.D.S" in s, obtain the "friends". - Answer: ``s[::2].lower() + Answer: ``s[::2].lower()`` Larger Questions ----------------