--- 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.
--- 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.
--- 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``]
+
--- 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.
--- 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
----------------