/oxnet-python-prep

Primary LanguageJupyter Notebook

Introduction to Python for OxNet

Computing is best learned by doing, and seeking help when you need it. This course involves self-study, interactive Jupyter notebook 'activities', with exercises at the end of each activity. The activity notebooks cover the following topics. When you are ready to get started you should click on the first link below. Before you do that, read the rest of this file so you know what you're doing.

  1. Variables, assignment and operator precedence
  2. Control statements
  3. Types, type conversions and floating point arithmetic
  4. Functions
  5. Library functions
  6. Data structures
  7. Numerical computation
  8. Plotting

The notebooks are designed to be completed in order. To complete an activity:

  1. Read through a notebook, and change parts of the programs if you want to experiment with what happens - this will help your understanding.
  2. Try to complete the exercises for the notebook before moving onto the next activity.

As you move through the activities you might need to revise some of the earlier notebooks.

Completing exercises

For the exercises, you complete them by replacing raise NotImplementedError() with your own code.

  • Use Markdown cells, and where appropriate add equations, to describe what your program is doing.
  • For longer exercises, you may want to break your program into multiple cells, with descriptions in Markdown before cells with code.
  • Most exercises include some automated testing to provide feedback on the correctness of your implementations. You will see these as assert lines. Don't worry, you are not expected to understand the test syntax to start.

You are not required to present your exercise solutions as part of the course. However, completing the exercises will help you learn the material and prepare you for the programming parts of the OxNet programme.

Jupyter Notebooks

This is a Jupyter Notebook. We will be computing using Jupyter Notebooks (https://jupyter.org/) and the programming language Python (https://www.python.org/). Jupyter Notebooks provide an interactive environment where you can mix text, equations, programming and visual outputs. This is technology is increasingly widely used, and it is all open-source.

If you are new to notebooks, see the notebook Using notebooks for guidance on how to interact with them. For more advanced tips and usage, see Notebook tips.

Alternatively, there are many good online tutorials for using such notebooks (e.g. 1, 2).

Credits

This repository was originally developed for the computing course in Part IA (Michaelmas Term) of the Engineering Tripos at University of Cambridge. The notebooks can be freely used, shared and modified. See the copyright and license notice below. The original material can be found at https://github.com/CambridgeEngineering/PartIA-Computing-Michaelmas

License and copyright

All material is copyright of Garth N. Wells (gnw20@cam.ac.uk).

All text is made available under the Creative Commons Attribution-ShareAlike 4.0 International Public License (https://creativecommons.org/licenses/by-sa/4.0/legalcode).

All computer code is released under the MIT license.

The MIT License (MIT) Copyright (c) 2016-2019 Garth N. Wells

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.