From e5e8c0fc4912015845881a25272dc9f7ae63a567 Mon Sep 17 00:00:00 2001 From: MaelainineChaibatta Date: Tue, 8 Jul 2025 11:25:19 +0100 Subject: [PATCH] Modified math_ops_challenge.ipynb --- .../math_ops/math_ops_challenge.ipynb | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/math_probability/math_ops/math_ops_challenge.ipynb b/math_probability/math_ops/math_ops_challenge.ipynb index 374f60ba..e60e5b5a 100644 --- a/math_probability/math_ops/math_ops_challenge.ipynb +++ b/math_probability/math_ops/math_ops_challenge.ipynb @@ -11,14 +11,14 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Challenge Notebook" + "# *Challenge Notebook:*" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "## Problem: Create a class with an insert method to insert an int to a list. It should also support calculating the max, min, mean, and mode in O(1).\n", + "## *Problem: Create a class with an insert method to insert an int to a list. It should also support calculating the max, min, mean, and mode in O(1).*\n", "\n", "* [Constraints](#Constraints)\n", "* [Test Cases](#Test-Cases)\n", @@ -32,7 +32,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Constraints\n", + "## *Constraints:*\n", "\n", "* Can we assume the inputs are valid?\n", " * No\n", @@ -52,7 +52,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Test Cases\n", + "## *Test Cases*\n", "\n", "* None -> TypeError\n", "* [] -> ValueError\n", @@ -85,13 +85,14 @@ "metadata": {}, "outputs": [], "source": [ + "#Solution Class\n", "class Solution(object):\n", "\n", - " def __init__(self, upper_limit=100):\n", + " def __init__(self, upper_limit=100): # init method constructor\n", " # TODO: Implement me\n", " pass\n", "\n", - " def insert(self, val):\n", + " def insert(self, val): # insert method \n", " # TODO: Implement me\n", " pass" ] @@ -120,7 +121,7 @@ "import unittest\n", "\n", "\n", - "class TestMathOps(unittest.TestCase):\n", + "class TestMathOps(unittest.TestCase): #define a class\n", "\n", " def test_math_ops(self):\n", " solution = Solution()\n", @@ -143,7 +144,7 @@ " print('Success: test_math_ops')\n", "\n", "\n", - "def main():\n", + "def main(): # method\n", " test = TestMathOps()\n", " test.test_math_ops()\n", "\n",