GCSE Python Recap
GCSE Python Recap
ondon omputing
William Marsh
School of Electronic Engineering and Computer Science
Queen Mary University of London
Aims
• What is programming?
• Recap GCSE Python
• Programming concepts
• Learning programming
• Outline the course
• Contents
• A level curricula
• Materials
What is Programming?
27 12 53 13 25 68 18 66 23 15 36
• Definition:
• One of the numbers in the list
• No other number in the list is larger
• Issue
• Very complex: need to guide students
Practical Exercise 2.4
• Look up the standard library online; read the
introduction
• In Chapter 2, (Built in Functions), lookup and try
• the bin() function
• the bool() function
• the range() function
def printX():!
print("This is x:", x)!
!
y = int(input("Enter a num> "))!
if y % 2 == 0:!
x = y!
!
printX()!
Errors (Practical Exercise 2.7)
• Syntax error
• Letters do not form a Python program
• E.g. brackets do not match
• Name (Scope) error
• Using a name that is not defined
• E.g. Reading a variable that has not been initialised
• Type errors
• Operation not available for these types
• E.g. "william" – "iam"
• Evaluation error
• Expression cannot be evaluated
• E.g. "william"[99]
Learning Programming
Axes of • Understanding programs
Learning • Can predict result of program
• Test it: what does this program
do?
• Writing programs
• Choose expressions and
Solving problems
statements
• Find bugs
• Test it: implement / complete
short program
• Solving problem
Writing programs • Problem à recipe
• Test it: solve open problems
Deepening and Mental Models
• Deeper understanding
• Initial understanding may be useful but partial
• Challenge and refine
• Example – assignment
• Understanding 1: assignment gives a name to
expression
• Understanding 2: assignment overwrites an existing
value in a variable (memory)
• Understanding 3: …
Example: Understanding Assignment
width = 10!
• Assignment as naming: height = 17!
area = height * width!
• … but what about: print(area)!
numA = ...!
numB = ...!
if numA < num B:!
numB = numA!
numA = numB!
print("The larger number is in numA")!
• Half-way techniques
• Pseudo code
• Flow charts
Software Development
• Do you:
Just Write a Program?
• Lifecycle
Analyse
• Describes the process
Design
• Analyse
• Understand problem Implement
• à specification
• Design
• Arrange parts Test
• How to design?
Characteristics of a Programmer
• Analytical
• Understanding problems
• Think like a computer
• Imaginative
• Invent solution
• Design program
• Resilient
• Trying different solutions
• Looking for bugs
Course Aims and Overview
Topics
1. Programming and s/w development
• Arrays and recursion
• Object-oriented programming
• Software design techniques
2. Algorithms and data structures
• Sorting and searching
• Trees and lists Computational
3. Computer systems
• Computer architecture
Thinking
• How programs are run
4. Theory of computing
• Finite state machines
• Language syntax and processing
A Level Curricula
• In transition: new from 2015
• A2 and AS separate
• Questions combine topics
• Differences between boards
• Mainly looked at: OCR, AQA