Lab 1

Introduction to python

In this first lab we’ll show you how to access the noteable server to work on code, how to import code from github to noteable, and then by working through the first notebook you’ll learn the basics of python. If that all sounds a bit complicated, don’t worry, it’s fairly simple and we’ll talk you through it step by step here. And if you can’t get it to work or have questions, we are available to help you in the drop-in labs on Teams.

Logging on to noteable

All the coding for this course will be done using interactive Python notebooks, which allow us to combine text and code in a single document. The interactive Python notebooks work using a “Jupyter Server”. The University of Edinburgh provides one that you can log into, and we will be accessing it via Learn. To do that:

  1. Go to the Simulating Language page on Learn
  2. Click on the ‘Content’ tab on the top
  3. Click on the Noteable link at the bottom
  4. Once you’ve logged on to the noteable service you may have to either “reconnect” or “start” your server (if there is a list of options available, stay with “Standard Notebook (Python 3)”). noteable screenshot
  5. Once you’ve started and connected/reconnected to the server you’ll be given an interface that will let you upload notebooks and navigate the files you’ll be creating.
  6. There is a button labelled +GitRepo. Click on that and enter this web address for the Git Repository URL: https://github.com/smkirby/simlang2023-24. You can leave all the other fields at their defaults or blank.
  7. Click on Clone. This will download all the latest versions of the notebook files onto your noteable account in a folder called simlang2023-24

You should only need to do this downloading of the notebook files once, unless I update any of the files during the semester, in which case I’ll tell you. (Note that if you’re reading this in advance of the first lab then probably a lot of the files won’t be there yet!) However, if you mess up any local copy of a notebook and want to return it back to the original, just delete or rename your notebook and then go through steps 6 and 7 again to restore the original versions.

Programming tasks for today’s lab

You will now see several notebook files (files whose name ends in “.ipynb”). The main part of today’s lab is the file lab1.ipynb - open that file by clicking on it, it’ll open up a new noteable window containing more explanatory text that you can work through. Your main task for labs this week is to work through that notebook! If you need help you can come to drop-in labs on Teams and get one-on-one help.

In addition, here is a notebook explaining what you can use notebooks for:

In the week following each lab, we will post the answers to the previous week’s labs in the form of a filled-out notebook. We won’t do this straight away, to encourage you to try for yourself, so they won’t load just now, but check back on Monday!

Re-use

This page was written by Kenny Smith and Simon Kirby, based on https://github.com/smkirby/SimLang/blob/master/README.md, written by Simon Kirby. All aspects of this work are licensed under a Creative Commons Attribution 4.0 International License.


Course main page

Project maintained by smkirby Hosted on GitHub Pages — Theme by mattgraham