Title: Teaching Python
1Jonathan Aylward Royds School Leeds
2...the beginning
Scratch
3...Python working group
Java Programming club
- Leeds A School
- Teachers
- Nat Strat advisors
- Staff from Leeds Uni
4... why Python?
John Cleese and Eric Idle created the programming
language Python in 91 AD Damn that stupid
language it deprived me of years of
sleep! That was when I dressed like a woman.
5... why Python?
- Uses an elegant syntax
- It's an easy-to-use language
- Comes with a large library
- Defining variables is easy
- Run-time rather than compile errors
- Interactive and IDLE development
6Lesson 1 What is a computer program
- What is a computer program?
- Python IDLE
- Basic input and output commands
- Variables to store temporary input
- Legal and illegal names
Activites Programming in interactive mode Bits
of code with errors to be fixed Data
Types Reseach languages
7Lesson 2 Flowcharts, sequencing and simple
decisions
- Flow charts
- Using IF statements
- Create Password testing program
Activities Cup of tea card sort True/False quiz
question in interactive mode
8Lesson 3 Prototyping a Hangman game
- Introduce hangman project
- Indentify buiding blocks of game
- Adapt password testing program
- Activites
- Determine rules by playing the game
9Lesson 4 Repeating and looping actions
- Loop
- For loop
- While loop
- Indenting code to control code
Activities Make text for 10, 20 green botles
song Scenarios given for students to indentify
loops Homework write simple program with
loops to navigate maze
10Lesson 5 Using functions to develop a better
game
- Importing functions from modules
- Concept of toolbox functions
- Lists
Acitvities Using Math, String Random
modules Using toolbox functions Lists to store
multiple values
11Lesson 6 Testing the final prototype
- Test the game
- ASCII art
- Improve final version to select random word
Activities Design hangman graphics Use test plan
12...the code
secretWord 'spreadsheet' wordLength
len(secretWord) lettersLeft wordLength guessedWo
rd '_' wordLength livesLeft
5 lettersGuessed print 'Can you guess this
secret word..' print guessedWord while livesLeft
gt0 and lettersLeft gt0 myGuess'' while
not myGuess.isalpha() inputText
raw_input('Please enter a letter...') if
len(inputText)0 inputText'?' myGuess
inputText0.lower() if not myGuess in
lettersGuessed lettersGuessed.append(myGu
ess) print 'Letters guessed so far
are' str(lettersGuessed)
if secretWord.find(myGuess)gt 0 print
'Your guess was in the secret word'
for i in range(wordLength) if
secretWordi myGuess
guessedWord.insert(i,myGuess)
guessedWord.pop(i1)
print guessedWord lettersLeft
guessedWord.count('_') print
str(lettersLeft)' letters remain' else
print 'Sorry you have not guessed a letter'
livesLeft livesLeft - 1 print
'You have ' str(livesLeft) ' lives
left' print 'game over' if lettersLeft 0 and
livesLeftgt0 print 'you won and guessed the
secret word' else print 'you ran out of
lives. The secret word was ' str(secretWord).upp
er()
13...other goodies
14...hardware
15...Operating Systems
ISO image via Virtual box
Year 8
Year 12
Live CD
16...install and configure applications
17...networking
- Ping Netmeeting
- IP configuration
- Topology
18...hackers defenders
MAC Filtering
Authentication WEP WPA
DHCP
Encryption AES PSK
SSID
...what can you teach? Network topologies Network
Media Security Client/Server network
19...contacts
Google groups Leeds A School Nic Efford
nde_at_comp.leeds.ac.uk Roye Neagle royce_at_comp.lee
ds.ac.uk Jonathan Aylward aylwarj01_at_leeds
learning.net
20(No Transcript)