31/01/2026

Week 9 Learning Summary

 Week 9 subject 1: Nested loops

  • For loop inside a for loop
  • Different loop variables used
  • Note how many times the contents of the loop are executed
Week 9 subject 2: User input and while loops
  • Use input() to get a line of input
  • Provide prompt as argument to input()
  • Convert the return value of input() with int() or float()
  • while loops can be used to get repeated user input
  • Common while loops format:
    • Initial input() before entering the loops
    • additional input() as the final step inside the loop

No comments: