Session material and solutions for the Beginner's Python course at the AstraZeneca Code Club
Spotted a mistake, dead link, or have suggestions for improvements? Report these here
Navigation:
- Introduction
- Using This Repository
- Quick Access to Resources
- Session Summaries
- Getting Help
- Acknowledgements
AstraZeneca Code Club's Beginner's Python course is designed for anyone completely new to Python or even programming in general. The course is self-contained and approaches the language in a slow and friendly manner, assuming no prior knowledge. All of our resources are free to be used by anyone—AZ employee or not. If you are an employee of AZ however, make sure you follow the Code Club group on Workplace for updates, support, and general Python fun.
Have fun learning!
To make learing Python as simple as possible, we have centred our course around the use of Google Colab, a free, interactive cloud environment for Python programming. You can get setup with Colab by visiting this link or searching for Google Colab (using Google Chrome, as this has the best compatibility, unsurprisingly). Sign up using a Google account and get started by going to File > New Python 3 Notebook
.
All of our exercise and solution sheets also have links to open them in Colab. Once you are finished with your work, save these to your own drive using File > Save a Copy in Drive
.
If you wish to avoid using Google Colab or want to code without an internet connection, you can setup up Anaconda on your computer to obtain a similiar, but local, experience. If you are on an AZ computer, use the software store to download this, and for personal computers visit this link. Once you have Anaconda installed, open the Anaconda Navigator (this is just a normal program you'll find in your start menu). Then, launch 'Jupyter Notebook' and click New > Python 3 Notebook
. This will create a blank Python 3 notebook just like with Colab. You can still use our templates by downloading the raw file from GitHub, placing it in your documents, and navigating to it in Jupyter.
Each session is contained in its own folder and includes the Powerpoint presentation given in the session, an answer template for the session exercises, a homework sheet to practice your skills, as well as corresponding solutions. All exercise and solutions notebooks will contain a link at the top of the page to open the document in Google Colab
The project solution is intended to be a model solution containing full documentation and testing. It is not expected for you to add such additional components to your solution but rather you should focus on the essential parts. A full solution is only provided as indication of the direction we want to be heading in and to build up experience with looking at source code.
We are still working on transferring the course to this repo, improving and standardising the content in the process. Links will appear here as soon as they are ready (which hopefully won't be long). If you want to be updated when changes are made, sign up to GitHub and click the watch icon at the top of the page (whilst you're at it, stars are appreciated!).
- Session One Presentation
- Session Two Presentation
- Session Three Presentation
- Session Four Presentation
- Session Five Presentation
- Session Six Presentation
- Session Seven Presentation
- Session Eight Presentation
- Session One Blank Template and Filled Template
- Session Two Blank Template and Filled Template
- Session Three Blank Template and Filled Template
- Session Four Blank Template and Filled Template
- Session Five Blank Template and Filled Template
- Session Six Blank Template and Filled Template
- Session Seven Blank Template and Filled Template
- Session Eight Blank Template and Filled Template
- Session One Exercises and Solutions
- Session Two Exercises and Solutions
- Session Three Exercises and Solutions
- Session Four Exercises and Solutions
- Session Five Exercises and Solutions
- Session Six Exercises and Solutions
- Session Seven Exercises and Solutions
- Session Eight Exercises and Solutions
- Get set up on Google Colab
- Let Python 'talk' to you using the
print()
function - Use Python as a basic calculator
- Give Python 'memory' using variables
- 'Talk' back to Python using the
input()
function - Learn why variable types are important
- Use lists to store multiple numbers
- Compute attributes of lists such as total, length, minimum and maximum
- Learn how to compare two difference numbers with comparison operators
- Combine conditions using Boolean operators
- Add logic to your code using
if
,elif
, andelse
- Use
while
loops to repeatedly run blocks of code
- Recap the use of lists in Python and use them to store more than just numbers
- Learn how to access individual items of lists as well as extract sub-lists
- Manipulate lists, adding, removing, and altering elements
- Understand the difference and similarities between tuples and lists
- Learn how to use
for
loops to run code a predetermined number of times - Loop through lists and ranges of numbers
- Escape loops using
break
andcontinue
- Learn how to enumerate loops
- Create functions to modularise your code
- Add function parameters
- Apply recursive strategies to solve common problems
- Understand the nature of variable scope
- Learn the limitations of lists/tuples
- Use dictionaries to overcome these
- Manipulate dictionaries, as with lists
- Loop through dictionaries in multiple ways
- Read from a text file
- Write text to a file
- Learn how to raise errors
- Use common built-in packages in your code
Checkout my other courses (written by me, in parallel with the AZ Code Club):
- Practical Python — learn more Python by applying your skills to fun, real-life problems. Prerequisite: Beginner's Python or equivalent
- Into the Tidyverse — learn your way around the tidyverse, a collection of R packages desgined to make data importing, manipulation, and visualisation as simple as possible. No prerequisites.
- SQL for Scientists (coming soon)
If you are internal to AstraZeneca your best port of call for recieving help with this course is via the Code Club workplace page. We're a friendly bunch so don't feel scared to post a question even if it seems simple—likely there is someone else with the same issue.
Failing that, any of the core contributers will be happy to help or prompt you in the right direction.
If you are external to AstraZenca, feel free to reach out to me on LinkedIn.
On top of any support the AZ Code Club can offer, there are many open-source resources for learning Python. Here are some of our favourites:
The original contributers to this course are (in alphabetical order):
- David McKinney
- Mark Porter
- Ryan Whittaker
- Sam Bradley
- Tim Hargreaves
The current version of the course is a vast redesign of the original material, with the addition of homework, solution notebooks, and content for three additional weeks. This adaptation was made solely by Tim Hargreaves, who also manages this repository.