{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"provenance":[],"generative_ai_disabled":true,"authorship_tag":"ABX9TyNnUYAF1Aaf1iQS6CXARA9J"},"kernelspec":{"name":"python3","display_name":"Python 3"},"language_info":{"name":"python"}},"cells":[{"cell_type":"code","execution_count":null,"metadata":{"id":"IIBWW5M2tgkP"},"outputs":[],"source":["# Task 1 - Add comments to explain which code is in the loop and will be repeated.\n","\n","  # Explain the circumstances in which the loop will run.\n","\n","answer = input(\"What is the capital of France?\")\n","\n","while answer != \"Paris\":\n","  print(\"Incorrect! Try again.\")\n","  answer = input(\"What is the capital of France?\")\n","\n","print(\"Correct!\")\n","\n","# Run the code to see if you're correct."]},{"cell_type":"code","source":["# Task 2\n","\n","  # Add a line of code to the loop that outputs an 'incorrect' message to the user and tells them what to do again.\n","  # Add a line of code to the loop that outputs an 'incorrect' message to the user, tells them what to do again and lets them re-input their number\n","  # Add a line of code AFTER the loop that outputs a thank you message and repeats the number entered back to the user.  Example - 'Thank you, you typed 7'\n","\n","num1 = int(input(\"Enter a number 10 or less\"))\n","\n","while num1 > 10:\n"],"metadata":{"id":"KhgyeTBMt4UE"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["# Task 3\n","\n","  # Write a program that stores a secret number in a variable (you decide the number and the name of the variable)\n","  # The user has to guess the secret number; the program should loop until they get it right.\n","  # Once the user has guessed correctly they get a congratulations message\n"],"metadata":{"id":"IkcVuQpUuxlQ"},"execution_count":null,"outputs":[]}]}