PYTHON PROGRAMMING Week 5 - Wednesday. THE FRIENDSHIP ALGORITHM Note the infinite loop!
-
Upload
lorraine-richardson -
Category
Documents
-
view
212 -
download
0
description
Transcript of PYTHON PROGRAMMING Week 5 - Wednesday. THE FRIENDSHIP ALGORITHM Note the infinite loop!
PYTHON PROGRAMMING Week 5 - Wednesday
THE FRIENDSHIP ALGORITHM https://www.youtube.com/watch?v=k0xgjUhEG3U 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?ReuseDivide workEasy to testUse as building bricksReduce 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