# data[].attributes.body
finally!

# data[].attributes.body
Thanks!

# data[].attributes.body
<3

# data[].attributes.body
Week 5 CAPSTONE Submission YASSSS!!

# data[].attributes.attachment_link.readable_text
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Capstone Assignment 1"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---\n",
    "âš ï¸**Notebook Instruction:**\n",
    "- <..> in this notebook are the placeholders for your codes.\n",
    "- You can insert multiple lines of code into a placeholder <..>.\n",
    "- Feel free to insert additional cell(s) as you need.\n",
    "- â¬‡ï¸ Enter your name below as a string below."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "Name = \"TKM\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<hr/>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Question 1 - Variable & Operators <br/>\n",
    "Question 2 - String, List, Tuple, Dictionary <br/>\n",
    "Question 3 - if-else, conditionals <br/>\n",
    "Question 4 - for loop <br/>\n",
    "Question 5 - while loop <br/>\n",
    "Question 6 - functions"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<hr/>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Question 1 - Variables & Operators"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> **[ Question 1A ]** <br/>\n",
    "Assign 59 to a variable <b>floor_area_1</b> <br/>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "floor_area_1 = 59"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> **[ Question 1B ]** <br/>\n",
    "Assign 82 to a variable <b>floor_area_2</b> "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "floor_area_2 = 82"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> **[ Question 1C ]** <br/>\n",
    ">- Prompt user to input a value and assign the value to a variable called <b>floor_area_3</b>. \n",
    ">- User will see \\\"Enter the floor area in square meters = \\\" (double quotes not included)\n",
    ">- Assume user keys in <b>60</b>.\n",
    ">- Change the data type of the variable, allowing the variable to be used in mathematical operations (e.g. summation and deduction)\n",
    ">\n",
    "> ðŸ“‘  <i>You can assume that the user will not input anything other than numbers. So there is no need to check for errors.</i><br/>\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Enter the floor area in square meters = 60\n"
     ]
    }
   ],
   "source": [
    "floor_area_3 = input(\"Enter the floor area in square meters = \")\n",
    "floor_area_3 = int(floor_area_3)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> **[ Question 1D ]**  <br/>\n",
    ">\n",
    ">Write the code to calculate the average of the three floor_area variables - **floor_area_1**, **floor_area_2**, and **floor_area_3**, and store the average value into a variable **floor_area_mean**.<br/>\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "import statistics\n",
    "\n",
    "floor_area_variables = [floor_area_1, floor_area_2, floor_area_3]\n",
    " \n",
    "floor_area_mean = statistics.mean(floor_area_variables)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> **[ Question 1E ]** <br/>\n",
    "Print out the value stored in <b>floor_area_mean</b> to produce the same output below: <br/>\n",
    "\n",
    ">Example output when the average floor area is 67 is shown below: <br/>\n",
    "\\\"The average floor area of the HDB units is 67.0 square meters.\\\"\n",
    "\n",
    "> ðŸ“‘  <i> your code should work with any value stored in the **floor_area_mean**</i><br/>\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The average floor area of the HDB units is 67 square meters.\n"
     ]
    }
   ],
   "source": [
    "print(f\"The average floor area of the HDB units is {floor_area_mean} square meters.\") "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Question 2 - String, List, Tuple, Dictionary"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> **[ Question 2A ]** <br/>\n",
    ">1) Decide on a data type (either String, List, Tuple, or Dictionary) to use for the following use case: <br/>\n",
    ">- I want to store the following information in a variable so that I can retrieve the town (e.g. Bedok), based on the postal code.<br/>\n",
    ">- I want to be able to change some of the values (e.g. Bedok) associated with a particular postal code from time to time.<br/>\n",
    ">- There should be no duplicated postal codes stored in the variable\n",
    ">- Order of the postal codes does not matter.<br/>\n",
    ">\n",
    ">2) When you have decided, create such a variable called <b>postal_to_town</b> and store the following information into it:<br/>\n",
    ">- 470703 --> Bedok \n",
    ">- 530406 --> Hougang \n",
    ">- 460002 --> BEDOK\n",
    ">- 330000 --> Clementi"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "postal_to_town = {\n",
    "    \"470703\" : \"Bedok\",\n",
    "    \"530406\" : \"Hougang\",\n",
    "    \"460002\" : \"BEDOK\",\n",
    "    \"330000\" : \"Clementi\"\n",
    "}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> **[ Question 2B ]** <br/>\n",
    "Change the town for the postal code 460002 to Sentence case (only first character is capitalized) <br/>\n",
    "You're **required to use a string method** to change the town's name to Sentence case.<br/>\n",
    "Print out the town for postal code 46002 after you have changed the value, you should have the output as below:<br/>\n",
    "\n",
    ">Bedok"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Bedok\n"
     ]
    }
   ],
   "source": [
    "postal_to_town[\"460002\"] = postal_to_town[\"460002\"].title() \n",
    "print(postal_to_town[\"460002\"]) "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> **[ Question 2C ]** <br/>\n",
    ">1) Decide on a data type (either String, List, Tuple, or Dictionary) to use for the following use case:\n",
    ">\n",
    ">- I want to read in values and store them as I read them in sequentially.\n",
    ">- Order matters.\n",
    ">- Repeated values are ok.\n",
    ">- I want to be able to add/remove some of the items too\n",
    ">\n",
    ">2) When you have decided, create such a variable called <b>yearmonth</b> and store the following information into it:\n",
    ">- 2015-07\n",
    ">- 2016-04\n",
    ">- 2014-04\n",
    ">- 2015-12\n",
    ">- 2016-12"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "yearmonth = [\"2015-07\", \"2016-04\", \"2014-04\", \"2015-12\", \"2016-12\"]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> **[ Question 2D ]** <br/>\n",
    "Retrieve the 3rd item in your variable **yearmonth**, then separately store the year and month into two variables called **year** and **month** respectively. <br/>\n",
    ">Using the variables **year** and **month**, print the **year** and **month** in a statement that looks like this: <br/>\n",
    "\n",
    ">The unit was sold in year 2014, month 4 of the year.<br/>\n",
    "\n",
    "> ðŸ“‘  <i> Note: You can use a string method, or index slicing, or any other method that you think is suitable. Also feel free to define new variable(s) if needed.</i><br/>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The unit was sold in year 2014, month 4 of the year.\n"
     ]
    }
   ],
   "source": [
    "year, month = yearmonth[2].split(\"-\")\n",
    "\n",
    "print(f\"The unit was sold in year {int(year)}, month {int(month)} of the year.\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Question 3 - If-Else"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> **[ Question 3A ]** <br/>\n",
    "Assign <b>True</b> to a variable <b>multistorey_carpark</b> <br/>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "multistorey_carpark = True"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> **[ Question 3B ]** <br/>\n",
    "Assign a string value <b>high</b> to a variable **floor_type** <br/>\n",
    "\n",
    ">ðŸ“‘  <i> Note: Assume there are only 2 categories of **floor_type**: a) *high* and b) *low*.</i>\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "floor_type = \"high\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> **[ Question 3C ]** <br/>\n",
    "Fill in the if-else logic below according to the rules here:<br/>\n",
    ">- If the unit is on high floor and has a multistorey carpark, it meets all requirements of the client<br/>\n",
    ">- If the unit is on high floor but does not have a multistorey carpark, it only meets the key criterion of the client<br/>\n",
    ">- If the unit is on low floor and has a multistorey a carpark, it only meets the non-critical criterion of the client <br/>\n",
    ">- If the unit is on low floor and does not have a multistorey carpark, it meets none of the requirements of the client <br/>\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "This unit meets all requirements of the client\n"
     ]
    }
   ],
   "source": [
    "if floor_type == \"high\" and multistorey_carpark == True:\n",
    "    print(\"This unit meets all requirements of the client\")\n",
    "elif floor_type == \"high\" and multistorey_carpark == False:\n",
    "    print(\"This unit only meets the key criterion of the client\")\n",
    "elif floor_type != \"high\" and multistorey_carpark == True:\n",
    "    print(\"This unit only meets the non-critical criterion of the client\")\n",
    "elif floor_type != \"high\" and multistorey_carpark == False:\n",
    "    print(\"This unit meets none of the requirements of the client\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Question 4 - For Loop "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> **[ Question 4A ]**  <br/>\n",
    "Initialise a list with six values [20, 5, 45, 9, 1, 15] (in precisely this sequence), and store it into a variable, <b>age_list</b>. \n",
    "\n",
    ">ðŸ“‘ *Note: These are the age of six different HDB blocks, in number of years*"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "age_list = [20, 5, 45, 9, 1, 15]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> **[ Question 4B ]** <br/>\n",
    "Write the code to loop through the list <b>age_list</b>, and print out the following:<br/>\n",
    ">- if the age of the HDB block is older than 20 years old, print <i>\"Matured Estate - x years\"</i> where x is the age in number.<br/>\n",
    ">- if the age of the HDB block is 20 or below and at least 5, print <i>\"Non-Matured Estate - x years\"</i> where x is that number.<br/>\n",
    ">- if the age of the HDB block is less than 5, it should be ignored. \n",
    "\n",
    "> Based on your list initialised in Question 4A, after running the code below, you should see:<br/>\n",
    "> Non-Matured Estate - 20 years<br/>\n",
    "> Non-Matured Estate - 5 years<br/>\n",
    "> Matured Estate - 45 years<br/>\n",
    "> Non-Matured Estate - 9 years<br/>\n",
    "> Non-Matured Estate - 15 years<br/>\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Non-Matured Estate - 20 years\n",
      "Non-Matured Estate - 5 years\n",
      "Matured Estate - 45 years\n",
      "Non-Matured Estate - 9 years\n",
      "Non-Matured Estate - 15 years\n"
     ]
    }
   ],
   "source": [
    "for age in age_list: \n",
    "    if age > 20: \n",
    "        print(\"Matured Estate -\", age,\"years\")\n",
    "    elif age >= 5:\n",
    "        print(\"Non-Matured Estate -\", age, \"years\")\n",
    "    elif age < 5: \n",
    "        pass"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    ">**[ Question 4C ]** <br/>\n",
    "In the cell below, modify your code from 4 b) such that:<br/>\n",
    "You initialise a variable <b>shortlisted</b> as an empty list (code is provided, no modification is needed for this first line of code). <br/>\n",
    "Then inside your <b>for loop</b>, you should add the age of the HDB block to the list **shortlisted** ONLY if the age is not more than 20 years old but is at least 5 years old.<br/>\n",
    "After you exit from the <b>for loop</b>, print out that number of items in the list.<br/>\n",
    "\n",
    "> Based on your list initialised in Question 4A), after running your codes below, you should see:<br/>\n",
    "Non-Matured Estate - 20 years <br/>\n",
    "Non-Matured Estate - 5 years <br/>\n",
    "Matured Estate - 45 years <br/>\n",
    "Non-Matured Estate - 9 years <br/>\n",
    "Non-Matured Estate - 15 years <br/>\n",
    "Length of the list is 4 <br/>\n",
    "\n",
    "> ðŸ“‘  <i> Note: You can use .append() and .remove() functions from a list object to add and drop items</i><br/>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Non-Matured Estate - 20 years\n",
      "Non-Matured Estate - 5 years\n",
      "Matured Estate - 45 years\n",
      "Non-Matured Estate - 9 years\n",
      "Non-Matured Estate - 15 years\n",
      "Length of the list is 4\n"
     ]
    }
   ],
   "source": [
    "shortlisted = []\n",
    "\n",
    "for age in age_list: \n",
    "    if age > 20: \n",
    "        print(\"Matured Estate -\", age,\"years\")\n",
    "    elif age >= 5:\n",
    "        print(\"Non-Matured Estate -\", age, \"years\")\n",
    "        shortlisted.append(age) \n",
    "    elif age < 5:\n",
    "        pass\n",
    "\n",
    "print(\"Length of the list is\", len(shortlisted))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Question 5 - While Loop "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> **[ Question 5A ]** <br/>\n",
    "Prompt a user for an input with 'Tell me the floor area in Square Meters'.<br/>\n",
    "Then, cast the input into an integer.<br/>\n",
    "Then, convert that Square Meters into Square Feet.<br/>\n",
    "Then, print out the floor area in Square Feet.<br/>\n",
    "\n",
    ">For example, if the user keyed in 110 square meters, the output would look like:<br/>\n",
    "Tell me the floor area in Square Meters: 110 <br/>\n",
    "The floor area in square meters converted to square feet is: 1184.04<br/>\n",
    "\n",
    "> ðŸ“‘  <i> Note:1 meter<sup>2</sup> = 10.764 feet<sup>2</sup></i><br/>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Tell me the floor area in Square Meters: 110\n",
      "The floor area in square meter in square feet is: 1184.04\n"
     ]
    }
   ],
   "source": [
    "floor_area_sqm = input('Tell me the floor area in Square Meters: ')\n",
    "floor_area_sqm = int(floor_area_sqm)\n",
    "floor_area_sqft = floor_area_sqm * 10.764 \n",
    "print(\"The floor area in square meter in square feet is:\", floor_area_sqft)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> **[ Question 5B ]** <br/>\n",
    "Rewrite your code in Question 5A such that the code runs within a while loop. Only exit when the user keys in <b>exit</b>.<br/>\n",
    "> Sample Output after you run your codes below: <br/>\n",
    "\n",
    "> Tell me the floor area in Square Meters: 90 <br/>\n",
    "> The floor area in square meter in square feet is: 968.76 <br/>\n",
    "> Tell me the floor area in Square Meters: 130 <br/>\n",
    "> The floor area in square meter in square feet is: 1399.32 <br/>\n",
    "> Tell me the floor area in Square Meters: exit\n",
    "\n",
    "> ðŸ“‘  <i> Note: You can assume the user will only key in either a number, or \"exit\", hence no need for error checking. </i><br/>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Tell me the floor area in Square Meters: 90\n",
      "The floor area in square meter in square feet is: 968.76\n",
      "Tell me the floor area in Square Meters: 130\n",
      "The floor area in square meter in square feet is: 1399.32\n",
      "Tell me the floor area in Square Meters: exit\n"
     ]
    }
   ],
   "source": [
    "floor_area_sqm = \"\"\n",
    "\n",
    "while floor_area_sqm != \"exit\": \n",
    "    floor_area_sqm = input('Tell me the floor area in Square Meters: ')\n",
    "    \n",
    "    \n",
    "    if floor_area_sqm != \"exit\":\n",
    "        floor_area_sqm = int(floor_area_sqm)\n",
    "        floor_area_sqm = floor_area_sqm * 10.764\n",
    "        print(\"The floor area in square meter in square feet is:\", floor_area_sqm)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Questions 6 - Functions"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> **[ Question 6A ]** <br/>\n",
    "All the addresses for HDB blocks are in the same pattern as shown in the examples below: <br/>\n",
    "556, ANG MO KIO AVE 10 <br/>\n",
    "28A, DOVER CRES <br/>\n",
    "13, HOLLAND DR <br/>\n",
    "9, MARSILING DR <br/>\n",
    "\n",
    "\n",
    "> Write a function called **get_address** that will take one **address** as the input parameter (e.g. \"13, HOLLAND DR\") and only return the **street_name** - \"HOLLAND DR\", which is the part after the \", \" <br/>\n",
    "\n",
    "> ðŸ“‘ Note: \n",
    ">>*You are required to string method - split() in your solution.* <br/>\n",
    ">>*Take note that there is no space before the street name that the function returns*"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_address(address):\n",
    "    street_name = address.split(', ')[1]\n",
    "    return street_name"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Then, test your function by calling it with the input parameter \"28A, DOVER CRES\"\n",
    "You should see the same output as below:\n",
    "'DOVER CRES'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'DOVER CRES'"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "get_address('28A, DOVER CRES') "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> **[ Question 6B ]** <br/>\n",
    "> A piece of information about each HDB unit sold is this \"storey_range\", which shows the floor as a range from X to Y. The information is always in this format, shown by the examples below: <br/>\n",
    "> 07 TO 09 <br/>\n",
    "> 04 TO 06 <br/>\n",
    "> 10 TO 12 <br/>\n",
    "> 19 TO 21 <br/>\n",
    "\n",
    "> Write a function called **\"get_middle_floor\"** that takes in one **storey_range** as the input parameter (e.g. \"07 TO 09\") <br/>\n",
    "> Within that function, do the following:<br/>\n",
    ">- Extract the first number (i.e. \"07\") and store in variable called **lower_end** <br/>\n",
    ">- Extract the second number (i.e. \"09\") and store in variable called **higher_end** <br/>\n",
    ">- Calculate the middle point of the two numbers and store in a variable called **middle** <br/>\n",
    ">- Return the value stored in the variable **middle** as integer<br/>\n",
    "\n",
    "\n",
    "> ðŸ“‘ <i> Note: You will need to convert (or cast) the data type for variables, **lower_end** and **higher_end**, before calculating the middle point of the two values<i/>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_middle_floor(storey_range):\n",
    "    lower_end = storey_range.split(' TO ')[0]\n",
    "    higher_end = storey_range.split(' TO ')[1]\n",
    "    middle = (int(lower_end) + int(higher_end)) / 2\n",
    "    return int(middle) "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> Then, test your function by invoking it with the input parameter \"\"04 TO 06\"\" <br/>\n",
    "> You should see the same output as below: <br/>\n",
    "> 5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "5"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "get_middle_floor(\"04 TO 06\") "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> **[ Question 6C ]** <br/>\n",
    "> Write a function called **get_floor_category** that similarly takes in one **storey_range** as the input parameter (e.g. \"04 TO 06\"), but it should return the **floor_category**, which is decided based on the following logics: <br/> \n",
    ">- if the value in the **middle** variable is from 11 floor and above, your function should return **\"High Floor\"**\n",
    ">- if the value in the **middle** variable is between 5 to 10, your function should return **\"Middle Floor\"**\n",
    ">- if the value in the **middle** variable is below 5, your function should return **\"Low Floor\"**\n",
    "\n",
    "> ðŸ“‘ <i>  You'll need to call your function **get_middle_floor** from Question 6B within this new function **get_floor_category**.\n",
    "<i/>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_floor_category(storey_range):\n",
    "    middle = get_middle_floor(storey_range) \n",
    "    \n",
    "    floor_category = \"\"\n",
    "    if middle >= 11:\n",
    "        floor_category = \"High Floor\"\n",
    "    elif middle >= 5:\n",
    "        floor_category = \"Middle Floor\"\n",
    "    else: \n",
    "        floor_category = \"Low Floor\"\n",
    "        \n",
    "    return floor_category"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> Then, test your function by invoking it with the input parameter \"\"04 TO 06\"\" <br/>\n",
    "> You should see the same output as below: <br/>\n",
    "> 'Middle Floor'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Middle Floor'"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "get_floor_category(\"04 TO 06\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "â¬‡ï¸ Enter your name below as a string below."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [],
   "source": [
    "myname = \"TKM\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---\n",
    "## END OF Capstone Assignment 1\n",
    "\n",
    "- Well done everyone!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}

# data[].attributes.body
Hi, please have a look :)

# data[].attributes.body
very cool

# data[].attributes.body
This is a re-submission after I have redo Q2b to correct to auto capitalize instead of manual capitalize. Thank you Kia Wei for your review.

# data[].attributes.body
Capstone assignment

# data[].attributes.body
have a good weekend!