Free interactive Python tutorials for beginners

Try it, debug it, extend it
Try it, debug it, extend it: Python tutorials

Over the next few weeks I’ll hopefully be publishing a series of 20 free interactive python tutorials for beginners.

Here’s the link to the list of resources

Each activity has four sections:

Theory: what you need to know if you’re in a hurry

Try it: working code snippets that you can adapt and use

Debug it: code sabotaged with common mistakes that you can practise fixing

Extend it: open ended project ideas for your to apply what you’ve learnt.

You can track your progress through each activity and generate a free PDF certificate showing your score at the end.

The first activity is all about getting your python program to output to the screen:

What attracts you to computing

Making computing accessible for all

This series of posts aims is aimed at UK secondary school teachers to give some free ideas and resources in order to help make computing lessons engaging and inclusive in order to help attract more and more students to continue with the subject at GCSE and beyond.

When students are choosing their GCSE options they seem to love asking teachers why we chose to teach our subjects.

Often, I can almost see the cogs turning inside some of my students’ heads, weighing up whether they should choose Computing over Art; ticking off the benefits of each subject as they make the first real choice that might affect the rest of their lives.

Whatever they use to make up their mind – who teaches the subject / what their friends are choosing / what they’re good at / what they enjoy – there’s clearly a lot more that we can do to promote Computer Science as a viable, challenging, enjoyable and worthwhile option. The national figures show a pretty poor GCSE uptake of GCSE Computer Science compared to other eBacc subjects and an abysmal uptake by girls. Boys, whilst outnumbering girls at KS4 and beyond, are being outperformed by girls from KS2 onwards. So there’s definitely something not right there that needs addressing.

CAS include
CAS #include. Making computing accessible for all

I’ve been slowly working through the brilliant advice on the CAS #include site about how to ensure that my Computing lessons aren’t just catering for people like me and it strikes me that the way to be inclusive for all also looks and sounds like the way to be engaging and stretching for all. This post aims to share some of the mistakes I’ve made as well as some of the things I’m trying to put right to make sure that all students get the most out of their computing lessons, hopefully also boosting recruitment at KS4 too.

I’ve come up with 6 Cs to use as a checklist for planning engaging and inclusive computing projects:

14: Reading data from a file in python

Being able to read and process data from a file is a very useful skill that can save hours of time by allowing you to automate repetitive tasks very quickly.

Use and store data in files
Reading data from a file in python

Contents:

Page 1: Intro

Page 2: The theory: learn what you need to know as fast as possible.

Page 3: Try it: try out and adapt some working python code snippets.

Page 4: Debug it: Learn how to find and fix common mistakes.

Page 5: Extend it: Choose a project idea to use your newfound python skills.

13: Writing data to a file in python

The power of python for processing data becomes even more useful when you can save the output from your program to a file.

Use and store data in files
Writing data to a file in python

Contents:

Page 1: Intro

Page 2: The theory: learn what you need to know as fast as possible.

Page 3: Try it: try out and adapt some working python code snippets.

Page 4: Debug it: Learn how to find and fix common mistakes.

Page 5: Extend it: Choose a project idea to use your newfound python skills.

Using create.withcode.uk to embed python code in an external website

Create.withcode.uk lets you write, run, debug and share python code in your browser. It’s designed for use in the classroom as a free online resource for teachers to help students grow in confidence, independence and resilience when writing python code.

Create.withcode.uk uses a subset of the python language which runs in your web browser. This allows you to safely run python code on almost any web-enabled device.

This is guide is for developers who have an educational tool which contains / generates python code, who want to allow users to view / edit / run that code with all the features that create.withcode.uk supports (e.g. microbit / pygame zero / gpiozero / tkinter emulation).

If you’re just looking to embed code that you’ve written in create.withcode.uk you don’t need this facility: just save your code (or Ctrl + S) and press the share button (or Alt + Shift + S) and you’ll find a link to easily link to or embed your code in your website or blog. If you use wordpress, this plugin is designed to simplify embedding python code: https://wordpress.org/plugins/create-with-code/

Embed python code in an external website with create.withcode.uk

API

This service is currently provided for free for all for educational use.

If you use this service, the URL and IP address of the computer posting python code is logged to track usage.

Usage may have to be limited if this service is abused. Please get in touch if you have any questions.

Please note

All you need to do is post the python code to https://create.withcode.uk via HTTP with the following parameters:

Parameter: py_files:

The code you want to display or run

This can be the contents of one python code e.g.

for i in range(10,0,-1):
print(i)
print("Blast off")

or it can be a JSON collection of multiple files e.g.

{
"program.py":"with open('readme.txt') as f: \n\t print(f.read())",
"readme.txt":"You can read from and write to files with create.withcode.uk"
}

Parameter: mode:

The way you want the code to be displayed.

Values:

normal: (default) load the code in a normal window with full toolbar and ads

embed: load the code in an editor window ideal for embedding in another site (no ads, {+} button pops out into a new window)

run: displays the result of the code running rather than the code itself

Try it:

URL: https://create.withcode.uk

HTTP method: post

Result: