diff options
author | Prabhu Ramachandran | 2017-02-22 15:21:25 +0530 |
---|---|---|
committer | Prabhu Ramachandran | 2017-02-22 15:21:25 +0530 |
commit | 8f66a792884c12b84b26bea603d71f9e77583bd7 (patch) | |
tree | 4e5d5d93108c2b65fedaf340e4ab629a9e932da9 /basic_python | |
parent | d5c20e445b193fad5cb4339f00e11212fdd39c0a (diff) | |
download | python-workshops-8f66a792884c12b84b26bea603d71f9e77583bd7.tar.gz python-workshops-8f66a792884c12b84b26bea603d71f9e77583bd7.tar.bz2 python-workshops-8f66a792884c12b84b26bea603d71f9e77583bd7.zip |
Adding readme for basic python workshop.
Diffstat (limited to 'basic_python')
-rw-r--r-- | basic_python/README.md | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/basic_python/README.md b/basic_python/README.md new file mode 100644 index 0000000..ddc0a1e --- /dev/null +++ b/basic_python/README.md @@ -0,0 +1,117 @@ +# Basic Python Programming + +This is a fairly intense two day workshop on learning basic Python +programming. The course is completely hands-on and requires each student to +have access to a computer with the necessary software installed and with +internet access. + +The workshop is designed to be taken with our online testing platform called +[yaksh](http://yaksh.fossee.in). After every hands-on lecture, we have a +practice session where students are expected to solve the given problem on our +online platform. The solutions to each problem will be shown and students will +proceed to the next problem. Close to 60 exercises will be solved by the +students over the course of this workshop. + +Students will also need to take a programming test to be assessed and receive +certificates. + +The course only covers basic Python programming. See the outline of the course +below to see what is covered. + + + +## Intended audience and pre-requisites + +This course requires that students have completed our "Introductory Scientific +Computing with Python" course and passed it. + +This course is designed to be taken by folks who do not have any significant +programming experience. The students should be comfortable using a computer +and editing text files. + +## Software and hardware requirements + +A laptop or reasonably configured desktop is recommended since this will be a +hands-on session. + +Please install Python 3.x (or 2.7.x if 3.x is not available) for this course. + +On Linux, Windows and Mac OS X it is easiest to install Python and many other +useful packages by installing Canopy. Download the Canopy Python distribution +for your OS and architecture from here: https://store.enthought.com/downloads . + +You could also use Anaconda or Conda along with the Spyder editor to obtain +the requirements. + +On many Linux distributions, Python is already available. We suggest that you +install Python 3.x and are comfortable with any text editor. Editors that +integrate with Python would be better. + + +## Outline of the course + +- Python Basics: + - Basic datatypes: numbers, booleans, and strings + - Basic operators: arithmetic, string operators, and string methods. + - Relational and logical operators. + - `assert` statements and built-ins. + - Simple input and output with `input` and `print`. + - Simple Exercises. + +- Practice exercises for the basics. + +- Basic control flow in Python: + - Conditional flow with `if/elif/else`. + - The ternary operators. + - Looping with `while`. + - Solving a simple problem. + - Looping with `for` and `range`. + - Using `break`, `continue`, and `pass`. + - Exercises + +- Practice exercises for control flow. + +- Core data structures in Python: + - Lists + - Tuples + - Dictionaries + - Sets + - Some exercises. + +- Practice exercises for the core data structures. + +- Writing functions. + - Simple functions taking no arguments, returning `None`. + - Functions taking arguments and returning values. + - Docstrings. + - Returning multiple values. + - Default arguments. + - Keyword arguments. + - Variable scope when defining functions. + - Mutable vs immutable arguments. + - Example functions to read for practice. + - Nested functions. + - Returning functions. + +- Practice exercises for functions. + +- Python modules. + - Creating modules + - Importing modules. + - `sys.path`, `PYTHONPATH` + - Running modules as scripts + - The use of `__name__`. + +- Reading and writing files. + - Reading files. + - Writing files, using `.write` and using `print` + - Example: parsing data from a file. + +- Python exceptions: + - Standard exception examples. + - Catching exceptions with `try/except` + - Catching multiple exceptions. + - Cleanup with `finally` + - Raising one's own exceptions. + +- Practice exercises for files and exceptions. |