Intermediate Python

Summary

That's all we have for this workshop. By now you should have a better understanding of how you can make your code more easily shared and reusable. In this workshow we have covered:

  • How to make you life easier with string formatting
  • Using the Python standard library to find and use useful functions
  • Ways of bundling up your code into reusable units with functions
  • Making it possible to share your code with others by moving code into modules
  • How to produce custom errors
  • How to compactly generate lists with list comprehensions

Worksheet

To give you something to take away with you to practise with, there is a worksheet with questions. If you get to this point in the session then feel free to start now, otherwise work on them between this session and the next.

What's next

Once you're comfortable with the material in this course, I suggest having a look at our course on best practices in software engineering which covers testing your code and writing documentation. Otherwise, if you haven't already, you may be interested in the course on data analysis in Python.

If you want to get some practice with Python coding, take a look at Codewars. This is a website which sets you small challenges and lets you discuss with others what the best solution might be.

Credits

This course was written by Matt Williams, based on the original course by Christopher Woods published at https://chryswoods.com/intermediate_python/. Some changes were made by the ACRC at the University of Bristol.

All text is published under a Creative Commons Attribution 4.0 International License with all code snippets licensed as MIT.

The source for the material can be found on GitLab where fixes are welcome.