PYTHON PROGRAMMING Week 5 - Wednesday
THE FRIENDSHIP ALGORITHM Note the infinite loop!
YESTERDAY What is an algorithm? What is a function? What is a parameter?
REMINDERS Key Terms & Concepts – weeks 1 & 2 Print out programs and annotate them
TODAY Algorithms Writing simple algorithms Stepwise refinement Python Writing functions with and without parameters How to call functions Some library/built in functions
YOUR OWN LIBRARY OF FUNCTIONS We can create a file of useful functions and then import it into other programs we write. Why bother? Reuse Divide work Easy to test Use as building bricks Reduce complexity Functions are our friends!
ALGORTHM DESIGN Stepwise refinement p20 - read Questions 1 – 6 (p20-21) – work in pairs
MASTERY TASK 2 On Edmodo for you to complete in class today
PRACTICAL Codecademy: Functions Plus Exercises Challenges
RECAP What is an algorithm? Stepwise refinement?
NEXT WEEK More on algorithms approaches to writing them why functions are our friends More on functions - Codecademy
HOMEWORK Read page 21 and complete questions 8, 9 and 10 on the next page. Challenge: Create a Python program for question 10