Added questions to writing python scripts.
--- a/writing_python_scripts/questions.rst Thu Nov 11 09:58:20 2010 +0530
+++ b/writing_python_scripts/questions.rst Thu Nov 11 10:37:26 2010 +0530
@@ -118,3 +118,29 @@
Hello World
Hello Test
+ 7. Say, we wish to use the ``pi`` value from the ``math`` module in
+ the standard library. How do we import it?
+
+ Answer: from math import pi OR import math.pi OR
+ import math.pi as pi
+
+
+ 8. A module should contain only functions, True or False?
+
+ Answer: False.
+
+
+Larger Questions
+----------------
+
+1. Look at the python documentation (from the web) and learn how to
+ make a folder containing some python files into a module.
+
+ Answer: Add a file named __init__.py
+
+2. We know that ``sys.path`` has the paths in which Python checks for
+ a module, when it is imported. Suppose you have a package ``utils``
+ in some location on your disk, which is not on the python path, how
+ will you import it?
+
+ Answer: Append that path to the ``sys.path`` variable.