Ash Manor School

Computing Department

Introduction to Textual programming languages - Python

In this unit we will be taking a whistle stop tour into the world of programming using the python programming language. There are amny programming languages and it is a reasonable question to ask why we are using python at school rather than C, Java, C++,Ruby, C#, Visual Basic, D, Haskell, F or Objective-C. The short answer to this is the python is a simple language which shares many features of the others, and to be honest we could learn to program in almost any language on the list, and many others. Python has a number of features which makes it ideal for learning to program. Firstly is is quite close to english. This makes it easier for you to remember. Secondly it does not worry too much about data type - they are important, but not a barrier to learning - like they can be in other languages. Thirdly it is powerful and fast, some peole may say that it is not as powerful and fast as say C++, but these people are often singing the praises of their favorite language. Hopefully once you learn python the second language you learn should be easier since they all share simmilar characteristics.

It is also worth noting that in this course we will be learning programming using python. Not learning to use python. There will be many times when we do things in a general way that can be used in all programming languages, even though there is an easier way in python. If you can find the easier way - use it, congratulations for showing some independance and research.

Talking of research - all information about python can be found in the documentation You should book mark this page. We will be using version 2.7, but teaching you to use version 3 syntax. The reason we are not using the latest and greatest version is that not everyone has upgraded to python 3 yet. the programming environment we will be using is not fully updated.

Aims

Hello World

In this activity will be setting up our programming environment and running a simple 'hello world' program. The purpose of this is to learn how to create a simple program and use the environment. This can be challenging in itself. You should bring your own earphone to these lessons - then you will be able to pause and play the videos at your own pace.

Step 1 - Set up a github account

Click here to link to github. You will need a github account as this is where we will be storing our work - github is a tool for hosting and sharing code - we can comment on each others work and share code easily using github. However at this stage - think of github as your store in the cloud

Step 2 - Set up a repository for your work

A repository is a store for your work in a particular program orr unit. Once we have set up this repository we will do all of our work in this unit in this repository. You should set up a repository called 'introduction to python' you should include a python ,gitignore, and a README.md file

Step 3 - Start cloud 9

c9.io is our development environment. It is here where we will write our code (mostly) and run it.

Step 4 - Hello World

In this step we will be writing our program and running it.

Step 5 - Putting it back in github

In this step we will be putting our code back into github.

Key learning

In this activity you have learned:

Click here for lesson

Quiz

See the moodle for a quick quiz

Hello You

In this section we will be investigating strings and functions. A string is a word programmers use to describe letters and characters joined in a row of text. In non-programmer speak - words, sentences, and books are all made up of strings. A function is a block of code that can be called many times.

Click here for lesson

Activity 3

Activity 4

Activity 5

Activity 6

offline check