Review: thinking, algorithms and Python basics
Time to look back at Weeks 1 to 9 with tasks that are new. Remember the main points. The four skills of computational thinking come before the code. The five steps are: understand, inputs and outputs, steps, code, test. A flowchart uses the oval, the rectangle, the parallelogram and the diamond. Algorithms can be sequential, conditional or loops, and there are search and sort algorithms. In Python, = stores and == tests; range(1, 6) stops before 6; a string cannot be changed but a list can; an index starts at 0. The flowchart in the picture reads a number and answers Big or Small. Example 2 shows its code. Work through the examples first, then try the practice tasks without looking back.
| Everyday situation | Skill |
|---|---|
| a pupil splits a poster project into text, pictures and colours | decomposition |
| Mona sees that all her stories have a title, a hero and a problem | pattern recognition |
| a route map keeps roads and stops but not shop colours | abstraction |
| Nour writes numbered steps for building a model | algorithm design |
1num = int(input("Enter a number: ")) 2if num > 10: 3 print("Big") 4else: 5 print("Small")
Enter a number: 12 Big
Write your own mixed review sheet with five tasks about Weeks 1 to 9: one matching task, one flowchart to code, one output to predict, one error to fix and one fixed-or-learned question. Swap it with a classmate and mark each other’s answers.
1text = "planet" 2print(text[1]) 3print(text[-2])
1numbers = [4, 8] 2numbers.append(6) 3numbers.remove(4) 4print(numbers)