{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"private_outputs":true,"provenance":[],"generative_ai_disabled":true,"authorship_tag":"ABX9TyMo9bA9kELA0NaRqXKr9dRW"},"kernelspec":{"name":"python3","display_name":"Python 3"},"language_info":{"name":"python"}},"cells":[{"cell_type":"code","execution_count":null,"metadata":{"id":"mZb4WeHNvCfY"},"outputs":[],"source":["# Task 1\n","\n","  # Add comments to explain what the counter variable is used for, and what +=1 does.\n","  # Add a comment that explains what the condition checks for.\n","  # Add a line of code inside the loop that outputs the counter variable every\n","  # time the loop runs.  What do you notice about what happens to it each time the loop repeats?\n","  # Add a line of code after the loop that outputs the message 'The loop has finished'\n","\n","counter = 1\n","\n","while counter < 5:\n","  print(\"This code is inside the loop\")\n","  counter += 1\n","\n"]},{"cell_type":"code","source":["# Task 2\n","\n","  # Add a line of code to the loop that subtracts one from the counter every time the loop runs\n","  # Add a line of code after the loop that outputs 'Blast off'\n","  # EXTRA CHALLENGE - Adapt the code so that the user inputs the start value of the counter variable.\n","\n","counter = 10\n","\n","while counter > 0:\n","  print(counter)\n"],"metadata":{"id":"cxnSVzwRvNW9"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["# Task 3\n","\n","  # Write a program that uses a loop to output the seven times table up\n","  # to 12 x 7 (HINT - use the counter variable and combine it with what you\n","  # learned about maths with variables.)\n","  # Output the multiplied number as part of a sentence.  Example - '1 times 7 is 7'\n"],"metadata":{"id":"Ls2NmOoZvi-E"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["  # EXTRA CHALLENGE - ask the user to input a number and output the multiplication table for the input."],"metadata":{"id":"hPrb5ii4vn-B"},"execution_count":null,"outputs":[]}]}