Block 2 – Programming

Topic List:

In this unit you will study and revise all the necessary material to prepare you properly for the programming tasks in the controlled assessment.

To begin with, if you haven’t already, please make sure you have installed Python 3.4 on your computer from this site:

  • Getting back into Python: Outputting and formatting text 
  • Data Types and Variables
  • Selection 
  • Loops
  • File Handling
  • Lists
  • Subprograms

 

Extra Practice:

  • The free e-books found here are very good, once you have a fair working knowledge of Python.
  • The on-line course (Free!!) found here is very good.  It will give you a valuable insight into good programming practice, and some really challenging exercises.
  • You know this one already, and you should by now have worked through the exercises on Codecademy
  • Fun with Python?  Look no further… 

Design Practice:

  1. Try this challenge.  Be very careful about the design, and make sure you carefully split your design into subprograms.

Python Revisited

Learning Objectives Get re-accustomed to using Python. Explore input/output at a very basic level. Look at mathematical functions Learning Outcomes All must complete a “Hello World” program, use Python to ask a question and print the answer to screen (input/output)  Make sure code is well commented. Most should complete the above, but adding some meaningful comments to […]

Variables Strike Back!

Learning Objectives Revise the difference between the data types string, int, char float and bool Trace the value stored in a variable throughout a program. Concatenate Strings. Create and manipulate Substrings. Learning Outcomes All must use different types of variable in a program, understanding the differences between these variables.  Most should complete the above, and swap values […]

Lists

  Explain that a list (known as an array in some languages) is another data structure. It lets you store a list of things. Show how lists use square brackets []. Demonstrate how to create a list and how lists are indexed. Demonstrate how to display individual elements and a range of elements in a […]

Loops

Learning Objectives Identify unnecessary repetition in code Understand the concept of iteration, or looping. Write simple programs using loops Recognise the difference between two types of loop – If and while. Learning Outcomes All must appreciate the need for a system to repeat code without re-typing.  Create a simple counting program. (Level 5) Most should complete the above, adapt […]

Selection

Learning Objectives Revise the need for branching in programs. Consider branching code Practice the syntax to create branching code in Python Learning Outcomes Must Create simple branching code, which is syntactically correct. Should complete the above, adding meaningful comments, look at if/else/elif. Could complete the above,understanding the concept of nested if statements, and also of the advantages of readable […]