Lite / Building Machines That Respond / Week 6
Week 6: Loops
This week you will
- Loop over a list of readings to total, count and find extremes, guarding against an empty list.
- Flag implausible readings and explain why a mean alone can mislead.
- Repeat a calculation with while until a condition is met, and say when for or while is the better choice.
Lessons
- for loops: summarise a sensor log · about 40 min
A motor logged a temperature every minute for a shift: 480 readings. How do four lines of Python find the average? - Count, flag and find extremes · about 40 min
A greenhouse thermometer's daily mean is a perfect 22.0 °C, yet it reported −40 °C and 85 °C. How could a mean hide that? - while loops: repeat until it's done · about 35 min
A motor cools by 20 % of its excess heat each minute. How long until it is safe to touch, without knowing the answer in advance?