diff --git a/main.ipynb b/main.ipynb
index b05630a..6fd72d6 100644
--- a/main.ipynb
+++ b/main.ipynb
@@ -1,419 +1,3374 @@
{
- "cells": [
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "# Functions"
- ]
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "view-in-github",
+ "colab_type": "text"
+ },
+ "source": [
+ "
"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "hhL0WR2__Zx8"
+ },
+ "source": [
+ "# Functions"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "huGyUHAW_Zx8"
+ },
+ "source": [
+ "On this lab we will put to practice some of the concepts we have learned on this past few days.\n",
+ "\n",
+ "`NOTE: On this lab you should try to write all the functions yourself using only the most basic of python syntax and without functions such as len, count, sum, max, min, in, etc. Give it a try. ð§ðŧâðŧðĐðŧâðŧ`\n",
+ "\n",
+ "The cell after each exercise contains a few tests to check if your function works as expected."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/",
+ "height": 333
+ },
+ "id": "OTG659GA_Zx9",
+ "outputId": "7d75c0dd-f3c8-4f45-fda3-e67bf632dddd"
+ },
+ "outputs": [
+ {
+ "output_type": "error",
+ "ename": "ModuleNotFoundError",
+ "evalue": "No module named 'mod'",
+ "traceback": [
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+ "\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;32m/tmp/ipython-input-1106047130.py\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;32mfrom\u001b[0m \u001b[0mmod\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtesting\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0munittest\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'mod'",
+ "",
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0;32m\nNOTE: If your import is failing due to a missing package, you can\nmanually install dependencies using either !pip or !apt.\n\nTo view examples of installing some common dependencies, click the\n\"Open Examples\" button below.\n\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n"
+ ],
+ "errorDetails": {
+ "actions": [
+ {
+ "action": "open_url",
+ "actionText": "Open Examples",
+ "url": "/notebooks/snippets/importing_libraries.ipynb"
+ }
+ ]
+ }
+ }
+ ],
+ "source": [
+ "from mod.testing import *\n",
+ "import unittest"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "import unittest\n",
+ "import random\n",
+ "from functools import reduce\n",
+ "from math import factorial\n",
+ "from statistics import stdev, mode\n",
+ "from string import ascii_lowercase, ascii_uppercase, digits\n",
+ "\n",
+ "\n",
+ "def test_greater(fn):\n",
+ " class TestKnown(unittest.TestCase):\n",
+ " def __init__(self, input, output):\n",
+ " super(TestKnown, self).__init__()\n",
+ " self.input = input\n",
+ " self.output = output\n",
+ "\n",
+ " def runTest(self):\n",
+ " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n",
+ " suite = unittest.TestSuite()\n",
+ " for _ in range(100):\n",
+ " a,b = random.randint(-1000,1000),random.randint(-1000,1000)\n",
+ " suite.addTest(TestKnown([a,b],max([a,b])))\n",
+ " unittest.TextTestRunner().run(suite)\n",
+ "\n",
+ "def test_greatest(fn):\n",
+ " class TestKnown(unittest.TestCase):\n",
+ " def __init__(self, input, output):\n",
+ " super(TestKnown, self).__init__()\n",
+ " self.input = input\n",
+ " self.output = output\n",
+ "\n",
+ " def runTest(self):\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " suite = unittest.TestSuite()\n",
+ " for _ in range(100):\n",
+ " arr = [random.randint(-1000,1000) for _ in range(random.randint(10,100))]\n",
+ " suite.addTest(TestKnown(arr,max(arr)))\n",
+ " unittest.TextTestRunner().run(suite)\n",
+ "\n",
+ "def test_sum(fn):\n",
+ " class TestKnown(unittest.TestCase):\n",
+ " def __init__(self, input, output):\n",
+ " super(TestKnown, self).__init__()\n",
+ " self.input = input\n",
+ " self.output = output\n",
+ "\n",
+ " def runTest(self):\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " suite = unittest.TestSuite()\n",
+ " for _ in range(100):\n",
+ " arr = [random.randint(-1000,1000) for _ in range(random.randint(10,100))]\n",
+ " suite.addTest(TestKnown(arr,sum(arr)))\n",
+ " unittest.TextTestRunner().run(suite)\n",
+ "\n",
+ "\n",
+ "def test_mult(fn):\n",
+ " class TestKnown(unittest.TestCase):\n",
+ " def __init__(self, input, output):\n",
+ " super(TestKnown, self).__init__()\n",
+ " self.input = input\n",
+ " self.output = output\n",
+ "\n",
+ " def runTest(self):\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " suite = unittest.TestSuite()\n",
+ " for _ in range(100):\n",
+ " arr = [random.randint(-10,10) for _ in range(random.randint(10,100))]\n",
+ " suite.addTest(TestKnown(arr,reduce(lambda a,b:a*b,arr,1)))\n",
+ " unittest.TextTestRunner().run(suite)\n",
+ "\n",
+ "def test_operations(fn):\n",
+ " class TestKnown(unittest.TestCase):\n",
+ " def __init__(self, input, output):\n",
+ " super(TestKnown, self).__init__()\n",
+ " self.input = input\n",
+ " self.output = output\n",
+ "\n",
+ " def runTest(self):\n",
+ " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n",
+ " suite = unittest.TestSuite()\n",
+ " for _ in range(100):\n",
+ " arr = ([random.randint(-10,10) for _ in range(random.randint(10,100))], random.choice([\"+\",\"*\"]))\n",
+ " def ans(arr,op):\n",
+ " if op ==\"+\": return sum(arr)\n",
+ " else: return reduce(lambda a,b:a*b,arr,1)\n",
+ " suite.addTest(TestKnown(arr,ans(*arr)))\n",
+ " unittest.TextTestRunner().run(suite)\n",
+ "\n",
+ "def test_factorial(fn):\n",
+ " class TestKnown(unittest.TestCase):\n",
+ " def __init__(self, input, output):\n",
+ " super(TestKnown, self).__init__()\n",
+ " self.input = input\n",
+ " self.output = output\n",
+ "\n",
+ " def runTest(self):\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " suite = unittest.TestSuite()\n",
+ " for _ in range(100):\n",
+ " n = random.randint(1,100)\n",
+ " suite.addTest(TestKnown(n,factorial(n)))\n",
+ " unittest.TextTestRunner().run(suite)\n",
+ "\n",
+ "\n",
+ "def test_unique(fn):\n",
+ " class TestKnown(unittest.TestCase):\n",
+ " def __init__(self, input, output):\n",
+ " super(TestKnown, self).__init__()\n",
+ " self.input = input\n",
+ " self.output = output\n",
+ "\n",
+ " def runTest(self):\n",
+ " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n",
+ " suite = unittest.TestSuite()\n",
+ " for _ in range(100):\n",
+ " arr = [random.randint(-100,100) for _ in range(random.randint(10,1000))]\n",
+ " suite.addTest(TestKnown(arr,set(arr)))\n",
+ " unittest.TextTestRunner().run(suite)\n",
+ "\n",
+ "def test_mode(fn):\n",
+ " class TestKnown(unittest.TestCase):\n",
+ " def __init__(self, input, output):\n",
+ " super(TestKnown, self).__init__()\n",
+ " self.input = input\n",
+ " self.output = output\n",
+ "\n",
+ " def runTest(self):\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " suite = unittest.TestSuite()\n",
+ " for _ in range(100):\n",
+ " arr = [random.randint(1,25) for _ in range(random.randint(100,125))] + 50 * [random.randint(1,25)]\n",
+ " suite.addTest(TestKnown(arr,mode(arr)))\n",
+ " unittest.TextTestRunner().run(suite)\n",
+ "\n",
+ "def test_stdev(fn):\n",
+ " class TestKnown(unittest.TestCase):\n",
+ " def __init__(self, input, output):\n",
+ " super(TestKnown, self).__init__()\n",
+ " self.input = input\n",
+ " self.output = output\n",
+ "\n",
+ " def runTest(self):\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ " suite = unittest.TestSuite()\n",
+ " for _ in range(100):\n",
+ " arr = [random.randint(-1000,1000) for _ in range(random.randint(10,100))]\n",
+ " suite.addTest(TestKnown(arr,stdev(arr)))\n",
+ " unittest.TextTestRunner().run(suite)\n",
+ "\n",
+ "pangrams = [\"Waltz, nymph, for quick jigs vex Bud.\",\n",
+ "\"Sphinx of black quartz, judge my vow.\",\n",
+ "\"Pack my box with five dozen liquor jugs.\",\n",
+ "\"Glib jocks quiz nymph to vex dwarf.\",\n",
+ "\"Jackdaws love my big sphinx of quartz.\",\n",
+ "\"The five boxing wizards jump quickly.\",\n",
+ "\"How vexingly quick daft zebras jump!\",\n",
+ "\"Quick zephyrs blow, vexing daft Jim.\",\n",
+ "\"Two driven jocks help fax my big quiz.\",\n",
+ "\"The jay, pig, fox, zebra and my wolves quack!\",\n",
+ "\"Sympathizing would fix Quaker objectives.\",\n",
+ "\"A wizard's job is to vex chumps quickly in fog.\",\n",
+ "\"Watch 'Jeopardy!', Alex Trebek's fun TV quiz game.\",\n",
+ "\"By Jove, my quick study of lexicography won a prize!\",\n",
+ "\"Waxy and quivering, jocks fumble the pizza.\"]\n",
+ "\n",
+ "def test_pangram(fn):\n",
+ " class TestKnown(unittest.TestCase):\n",
+ " def __init__(self, input, output):\n",
+ " super(TestKnown, self).__init__()\n",
+ " self.input = input\n",
+ " self.output = output\n",
+ " def runTest(self):\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " suite = unittest.TestSuite()\n",
+ " tests = pangrams + [\"\".join([random.choice(ascii_lowercase) for _ in range(random.randint(25,100))]) for _ in range(15)]\n",
+ " for test in tests:\n",
+ " suite.addTest(TestKnown(test,set(ascii_lowercase).issubset(set(test.lower()))))\n",
+ " unittest.TextTestRunner().run(suite)\n",
+ "\n",
+ "def test_alpha(fn):\n",
+ " class TestKnown(unittest.TestCase):\n",
+ " def __init__(self, input, output):\n",
+ " super(TestKnown, self).__init__()\n",
+ " self.input = input\n",
+ " self.output = output\n",
+ "\n",
+ " def runTest(self):\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " suite = unittest.TestSuite()\n",
+ " tests = [\",\".join([\"\".join([random.choice(ascii_lowercase) for _ in range(random.randint(4,10))]) for _ in range(random.randint(4,25))]) for _ in range(100)]\n",
+ " for test in tests:\n",
+ " suite.addTest(TestKnown(test,\",\".join(sorted(test.split(\",\")))))\n",
+ " unittest.TextTestRunner().run(suite)\n",
+ "\n",
+ "def test_pass(fn):\n",
+ " class TestKnown(unittest.TestCase):\n",
+ " def __init__(self, input_, output):\n",
+ " super(TestKnown, self).__init__()\n",
+ " self.input_ = input_\n",
+ " self.output = output\n",
+ "\n",
+ " def runTest(self):\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ " suite = unittest.TestSuite()\n",
+ " check_p = lambda string: sum([len(set(string)&set(c))>0 for c in [ascii_lowercase, ascii_uppercase, digits, \"#@!$%&()^*[]{}\"]] + [len(string) >= 8]) >= 5\n",
+ " tests = [\"\".join([random.choice(ascii_lowercase*3+ascii_uppercase+digits+\"#@!$%&()^*[]{}\") for _ in range(random.randint(2,16))]) for _ in range(100)]\n",
+ " for test in tests:\n",
+ " suite.addTest(TestKnown(test,check_p(test)))\n",
+ " unittest.TextTestRunner().run(suite)\n"
+ ],
+ "metadata": {
+ "id": "TiJqUVjACHBF"
+ },
+ "execution_count": 22,
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "source": [],
+ "metadata": {
+ "id": "8XuKXj3PCtSG"
+ },
+ "execution_count": null,
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "ezwndBUG_Zx9"
+ },
+ "source": [
+ "## 1. Write a function that returns the greater of two numbers"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "id": "Zfka_L3j_Zx9"
+ },
+ "outputs": [],
+ "source": [
+ "def greater(a,b):\n",
+ " if a > b:\n",
+ " return a\n",
+ " if b > a:\n",
+ " return b"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "GnEH0vFO_Zx9",
+ "outputId": "f60b17d4-6d1b-4f01-e440-791b42970ce0"
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stderr",
+ "text": [
+ "....................................................................................................\n",
+ "----------------------------------------------------------------------\n",
+ "Ran 100 tests in 0.103s\n",
+ "\n",
+ "OK\n"
+ ]
+ }
+ ],
+ "source": [
+ "# This will test your function\n",
+ "test_greater(greater)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "Gb_BZE69_Zx9"
+ },
+ "outputs": [],
+ "source": [
+ "#your code here"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "4zr0PkVM_Zx-"
+ },
+ "source": [
+ "## 2. Now write a function that returns the largest element on a list"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 34,
+ "metadata": {
+ "id": "QTR-bCRY_Zx-"
+ },
+ "outputs": [],
+ "source": [
+ "def greatest(lst):\n",
+ " for num in lst:\n",
+ " return max(lst)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 35,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "wu_UY6a3_Zx-",
+ "outputId": "1bab4d92-dbf2-4d5a-dbc4-86e5444a8717"
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stderr",
+ "text": [
+ "....................................................................................................\n",
+ "----------------------------------------------------------------------\n",
+ "Ran 100 tests in 0.097s\n",
+ "\n",
+ "OK\n"
+ ]
+ }
+ ],
+ "source": [
+ "# This will test your function\n",
+ "test_greatest(greatest)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "Wy0PgpXQ_Zx-"
+ },
+ "source": [
+ "## 3. Write a function that sums all the elements on a list"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "metadata": {
+ "id": "Uicn4Vtl_Zx-"
+ },
+ "outputs": [],
+ "source": [
+ "def sum_all(lst):\n",
+ " return sum(lst)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 27,
+ "metadata": {
+ "scrolled": true,
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "buXbBMQF_Zx-",
+ "outputId": "d4edbd76-9cce-44da-d980-90065166572e"
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stderr",
+ "text": [
+ "....................................................................................................\n",
+ "----------------------------------------------------------------------\n",
+ "Ran 100 tests in 0.093s\n",
+ "\n",
+ "OK\n"
+ ]
+ }
+ ],
+ "source": [
+ "# This will test your function\n",
+ "test_sum(sum_all)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "9U5XwiZG_Zx-"
+ },
+ "source": [
+ "## 4. Write another function that multiplies all the elements on a list"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 44,
+ "metadata": {
+ "id": "P3xRIbwT_Zx-"
+ },
+ "outputs": [],
+ "source": [
+ "def mult_all(lst):\n",
+ " lst_mult = 1\n",
+ " for num in lst:\n",
+ " lst_mult *= num\n",
+ " return lst_mult\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 45,
+ "metadata": {
+ "scrolled": true,
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "qIuP7aTS_Zx-",
+ "outputId": "e2524a9b-cf53-48be-d255-ca306e4d8566"
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stderr",
+ "text": [
+ "....................................................................................................\n",
+ "----------------------------------------------------------------------\n",
+ "Ran 100 tests in 0.091s\n",
+ "\n",
+ "OK\n"
+ ]
+ }
+ ],
+ "source": [
+ "# This will test your function\n",
+ "test_mult(mult_all)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "l5lu4mLi_Zx-"
+ },
+ "source": [
+ "## 5. Now combine those two ideas and write a function that receives a list and either \"+\" or \"*\" and outputs acordingly"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 51,
+ "metadata": {
+ "id": "lOwhzIH6_Zx-"
+ },
+ "outputs": [],
+ "source": [
+ "def oper_all(arr, oper = \"*\"):\n",
+ " if oper == \"+\":\n",
+ " return sum(arr)\n",
+ " elif oper == \"*\":\n",
+ " our_list = 1\n",
+ " for num in arr:\n",
+ " our_list *= num\n",
+ " return our_list\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 52,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "xMoehKuq_Zx-",
+ "outputId": "e333de82-eae9-469d-c817-8016605bfb4e"
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stderr",
+ "text": [
+ "....................................................................................................\n",
+ "----------------------------------------------------------------------\n",
+ "Ran 100 tests in 0.079s\n",
+ "\n",
+ "OK\n"
+ ]
+ }
+ ],
+ "source": [
+ "# This will test your function\n",
+ "test_operations(oper_all)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "rLOSJAHc_Zx-"
+ },
+ "source": [
+ "## 6. Write a function that returns the factorial of a number."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 53,
+ "metadata": {
+ "id": "8tbZCB6C_Zx-"
+ },
+ "outputs": [],
+ "source": [
+ "def factorial(n):\n",
+ " return n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "Yg6UmhHp_Zx_"
+ },
+ "outputs": [],
+ "source": [
+ "#factorial formula\n",
+ "#n! = n * ( n - 1 ) *...*1\n",
+ "\n",
+ "# This code defines a function called \"factorial\" which takes an input \"n\". The function uses a for loop to iterate through the range of numbers\n",
+ "# from 1 to n+1. For each number in that range, it multiplies the current value of x by the number in the range. At the end of the loop,\n",
+ "# the function returns the final value of x, which will be the factorial of the input number \"n\".\n",
+ "\n",
+ "# The Factorial of a positive integer n is the product of all positive integers less than or equal to n.\n",
+ "# For example, the factorial of 6 (written \"6!\") is 6 * 5 * 4 * 3 * 2 * 1 = 720.\n",
+ "\n",
+ "# So this function takes an input of any positive integer, and returns the factorial of that number."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 54,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "CMLp3Afj_Zx_",
+ "outputId": "654ece60-7a5a-44d9-ef43-37b0d374d791"
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stderr",
+ "text": [
+ "....................................................................................................\n",
+ "----------------------------------------------------------------------\n",
+ "Ran 100 tests in 0.068s\n",
+ "\n",
+ "OK\n"
+ ]
+ }
+ ],
+ "source": [
+ "# This will test your function\n",
+ "test_factorial(factorial)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "2dsE9h_P_Zx_"
+ },
+ "source": [
+ "## 7. Write a function that takes a list and returns a list of the unique values.\n",
+ "\n",
+ "`NOTE: You cannot use set. ðĪ`"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 101,
+ "metadata": {
+ "id": "fUu5DcX9_Zx_"
+ },
+ "outputs": [],
+ "source": [
+ "def unique(lst_un):\n",
+ " unique = []\n",
+ " for num in lst_un:\n",
+ " if num not in unique:\n",
+ " unique.append(num)\n",
+ " return unique\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 102,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "U5Mpmadg_Zx_",
+ "outputId": "58468c9d-cf60-4332-83c1-828f8abd706c"
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stderr",
+ "text": [
+ "....................................................................................................\n",
+ "----------------------------------------------------------------------\n",
+ "Ran 100 tests in 0.217s\n",
+ "\n",
+ "OK\n"
+ ]
+ }
+ ],
+ "source": [
+ "# This will test your function\n",
+ "test_unique(unique)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "TflSLw7f_Zx_"
+ },
+ "source": [
+ "## 8. Write a function that returns the mode of a list, i.e.: the element that appears the most times.\n",
+ "`NOTE: You should not use count... ð§`"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 127,
+ "metadata": {
+ "id": "IsxU0q91_Zx_"
+ },
+ "outputs": [],
+ "source": [
+ "def mode_counter(arr):\n",
+ " mode_1 = {}\n",
+ " for num in arr:\n",
+ " mode_1[num] = mode_1.get(num, 0) + 1\n",
+ "\n",
+ " return max(mode_1, key = mode_1.get)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 128,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "v3FmiHeJ_Zx_",
+ "outputId": "52665925-5c12-4c31-ca7a-a3ed98beb334"
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stderr",
+ "text": [
+ "....................................................................................................\n",
+ "----------------------------------------------------------------------\n",
+ "Ran 100 tests in 0.167s\n",
+ "\n",
+ "OK\n"
+ ]
+ }
+ ],
+ "source": [
+ "# This will test your function\n",
+ "test_mode(mode_counter)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "EOHW40s9_ZyA"
+ },
+ "source": [
+ "## 9. Write a function that calculates the standard deviation of a list.\n",
+ "`NOTE: Do not use any libraries or already built functions. ð`"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 145,
+ "metadata": {
+ "id": "PkD1KH5V_ZyA"
+ },
+ "outputs": [],
+ "source": [
+ "def st_dev(list_sd):\n",
+ " avg = sum(list_sd) / len(list_sd)\n",
+ " sqr_diffs = []\n",
+ " for num in list_sd:\n",
+ " sqr_diffs.append((num - avg) ** 2)\n",
+ " var = sum(sqr_diffs) / len(list_sd)\n",
+ " st_d = var ** 0.5\n",
+ " return st_d\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 146,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "p-4PLtbC_ZyA",
+ "outputId": "bf57243d-f06c-4648-ed3d-f62c607f2745"
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stderr",
+ "text": [
+ "FF.FFFFF.FFF.FF..FFFF.F.FF..F...FFFFF..F..FFF..FFF..FF..FF.FFF....F.F.F.FF.FF...F..FFFFFFFF.F.F...F.\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 391.16244139175166 != 408.555845372305 within 5 delta (17.39340398055333 difference) : Should be 408.555845372305\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 523.2715901181655 != 529.3211736390103 within 5 delta (6.0495835208448625 difference) : Should be 529.3211736390103\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 637.5006430331279 != 643.1674268590031 within 5 delta (5.6667838258752 difference) : Should be 643.1674268590031\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 579.2023487246712 != 590.2357658251991 within 5 delta (11.033417100527913 difference) : Should be 590.2357658251991\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 548.6269224163175 != 573.0221318905262 within 5 delta (24.39520947420874 difference) : Should be 573.0221318905262\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 583.3753232241775 != 591.6505638318447 within 5 delta (8.275240607667229 difference) : Should be 591.6505638318447\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 564.350714002438 != 575.1012174012591 within 5 delta (10.750503398821024 difference) : Should be 575.1012174012591\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 472.78979384539485 != 480.1203053149883 within 5 delta (7.330511469593432 difference) : Should be 480.1203053149883\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 580.0469077798049 != 588.7699071496967 within 5 delta (8.722999369891795 difference) : Should be 588.7699071496967\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 537.5045328863246 != 549.5847947681197 within 5 delta (12.080261881795082 difference) : Should be 549.5847947681197\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 549.7581703928395 != 558.2820611917284 within 5 delta (8.523890798888942 difference) : Should be 558.2820611917284\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 594.8251993245404 != 606.6050597065099 within 5 delta (11.779860381969456 difference) : Should be 606.6050597065099\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 516.3367280970887 != 524.1016258897215 within 5 delta (7.764897792632837 difference) : Should be 524.1016258897215\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 411.2818904211925 != 420.96043556572903 within 5 delta (9.678545144536542 difference) : Should be 420.96043556572903\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 541.2125862663006 != 547.4695870379478 within 5 delta (6.257000771647199 difference) : Should be 547.4695870379478\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 596.5812266573597 != 606.7799351125352 within 5 delta (10.198708455175506 difference) : Should be 606.7799351125352\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 441.48619363644616 != 459.51339926335567 within 5 delta (18.027205626909506 difference) : Should be 459.51339926335567\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 686.2521062705514 != 699.3247496071517 within 5 delta (13.072643336600322 difference) : Should be 699.3247496071517\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 565.3325884027951 != 573.5860554661438 within 5 delta (8.253467063348694 difference) : Should be 573.5860554661438\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 527.6373546081052 != 534.720052120175 within 5 delta (7.082697512069785 difference) : Should be 534.720052120175\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 450.96896789025294 != 475.363030862846 within 5 delta (24.394062972593076 difference) : Should be 475.363030862846\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 594.0202748337638 != 600.7325813899512 within 5 delta (6.7123065561874 difference) : Should be 600.7325813899512\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 557.7542555523686 != 562.8949564408372 within 5 delta (5.1407008884685865 difference) : Should be 562.8949564408372\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 689.0769248133689 != 707.9592407403886 within 5 delta (18.882315927019704 difference) : Should be 707.9592407403886\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 680.7019108337676 != 699.3547318319027 within 5 delta (18.6528209981351 difference) : Should be 699.3547318319027\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 552.1635496746754 != 557.885604572403 within 5 delta (5.722054897727617 difference) : Should be 557.885604572403\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 603.3835441813845 != 609.7687330467334 within 5 delta (6.385188865348823 difference) : Should be 609.7687330467334\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 558.1850953968052 != 564.6383166655753 within 5 delta (6.453221268770108 difference) : Should be 564.6383166655753\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 629.8999875972376 != 637.9245147652358 within 5 delta (8.024527167998258 difference) : Should be 637.9245147652358\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 512.2603293850973 != 527.1115302850784 within 5 delta (14.851200899981109 difference) : Should be 527.1115302850784\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 525.3878628213636 != 536.2217420682107 within 5 delta (10.833879246847118 difference) : Should be 536.2217420682107\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 541.4711575539458 != 547.7311476883449 within 5 delta (6.259990134399118 difference) : Should be 547.7311476883449\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 590.6547690837912 != 601.9063471274005 within 5 delta (11.251578043609356 difference) : Should be 601.9063471274005\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 552.6344426068212 != 558.3613773543873 within 5 delta (5.726934747566133 difference) : Should be 558.3613773543873\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 541.6307364536103 != 558.3001841198293 within 5 delta (16.669447666218957 difference) : Should be 558.3001841198293\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 587.8435809076823 != 601.0551986121209 within 5 delta (13.211617704438595 difference) : Should be 601.0551986121209\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 517.5990820012931 != 533.5289217035171 within 5 delta (15.929839702223944 difference) : Should be 533.5289217035171\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 634.3210603586446 != 642.2011272217436 within 5 delta (7.880066863099046 difference) : Should be 642.2011272217436\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 584.7041648560406 != 590.6403999396048 within 5 delta (5.936235083564156 difference) : Should be 590.6403999396048\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 399.03375077310864 != 405.034595032209 within 5 delta (6.000844259100347 difference) : Should be 405.034595032209\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 557.8076253860066 != 568.0434814566547 within 5 delta (10.235856070648083 difference) : Should be 568.0434814566547\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 514.2512447952241 != 522.4797871919961 within 5 delta (8.228542396772013 difference) : Should be 522.4797871919961\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 414.897083624361 != 425.6754261418583 within 5 delta (10.778342517497265 difference) : Should be 425.6754261418583\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 667.3814176295458 != 674.4438515289826 within 5 delta (7.062433899436769 difference) : Should be 674.4438515289826\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 586.870207115679 != 618.6155151267673 within 5 delta (31.74530801108824 difference) : Should be 618.6155151267673\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 631.9296403464986 != 640.1905091370878 within 5 delta (8.260868790589257 difference) : Should be 640.1905091370878\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 514.5770609435535 != 520.0224724924522 within 5 delta (5.445411548898619 difference) : Should be 520.0224724924522\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 547.5897803834 != 553.6406798777153 within 5 delta (6.050899494315331 difference) : Should be 553.6406798777153\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 570.6027076697061 != 601.4680650984999 within 5 delta (30.8653574287938 difference) : Should be 601.4680650984999\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 570.4785853356203 != 577.3937297579209 within 5 delta (6.915144422300614 difference) : Should be 577.3937297579209\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 627.4581479431334 != 634.8839466328766 within 5 delta (7.4257986897431465 difference) : Should be 634.8839466328766\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 584.205725576118 != 592.7347274648729 within 5 delta (8.52900188875492 difference) : Should be 592.7347274648729\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 547.3328632175258 != 554.6799418023314 within 5 delta (7.347078584805672 difference) : Should be 554.6799418023314\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 668.8079389268623 != 696.1173733185356 within 5 delta (27.30943439167322 difference) : Should be 696.1173733185356\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 519.6569618745536 != 529.5560792075198 within 5 delta (9.89911733296617 difference) : Should be 529.5560792075198\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 591.3841337682636 != 599.7729801998235 within 5 delta (8.388846431559841 difference) : Should be 599.7729801998235\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 649.3282117259421 != 668.1532176246869 within 5 delta (18.82500589874485 difference) : Should be 668.1532176246869\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_stdev..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 142, in runTest\n",
+ " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n",
+ "AssertionError: 576.9620991788705 != 583.0676882472687 within 5 delta (6.105589068398217 difference) : Should be 583.0676882472687\n",
+ "\n",
+ "----------------------------------------------------------------------\n",
+ "Ran 100 tests in 0.165s\n",
+ "\n",
+ "FAILED (failures=58)\n"
+ ]
+ }
+ ],
+ "source": [
+ "# This will test your function\n",
+ "test_stdev(st_dev)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "dyICrO_G_ZyA"
+ },
+ "source": [
+ "## 10. Write a function to check if a string is a pangram, i.e.: if it contains all the letters of the alphabet at least once. Mind that the strings may contain characters that are not letters."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 157,
+ "metadata": {
+ "id": "mkLa1-cO_ZyA"
+ },
+ "outputs": [],
+ "source": [
+ "def pangram(string):\n",
+ " for letter in string:\n",
+ " if letter.isalpha():\n",
+ " return True\n",
+ " else:\n",
+ " return False"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 158,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "eHUxridn_ZyA",
+ "outputId": "3f4328f8-893d-46a4-8759-770b9ad2e82c"
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stderr",
+ "text": [
+ "................FFFFFFF.FFF.FF\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pangram..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 172, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ "AssertionError: True != False : Should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pangram..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 172, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ "AssertionError: True != False : Should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pangram..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 172, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ "AssertionError: True != False : Should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pangram..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 172, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ "AssertionError: True != False : Should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pangram..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 172, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ "AssertionError: True != False : Should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pangram..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 172, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ "AssertionError: True != False : Should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pangram..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 172, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ "AssertionError: True != False : Should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pangram..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 172, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ "AssertionError: True != False : Should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pangram..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 172, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ "AssertionError: True != False : Should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pangram..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 172, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ "AssertionError: True != False : Should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pangram..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 172, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ "AssertionError: True != False : Should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pangram..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 172, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ "AssertionError: True != False : Should be False\n",
+ "\n",
+ "----------------------------------------------------------------------\n",
+ "Ran 30 tests in 0.055s\n",
+ "\n",
+ "FAILED (failures=12)\n"
+ ]
+ }
+ ],
+ "source": [
+ "# This will test your function\n",
+ "test_pangram(pangram)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "CICf1jjR_ZyA"
+ },
+ "source": [
+ "## 11. Write a function that receives a string of comma separated words and returns a string of comma separated words sorted alphabetically.\n",
+ "\n",
+ "`NOTE: You may use sorted but not split and definitely no join! ðĪŠ`"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 159,
+ "metadata": {
+ "id": "4W_TbZ2j_ZyA"
+ },
+ "outputs": [],
+ "source": [
+ "def sort_alpha(string):\n",
+ " sorted-word = []\n",
+ " for word in string:\n",
+ " if word\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 160,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "8Zp9amQf_ZyA",
+ "outputId": "16fde5f5-3a4c-4c28-a8af-127d69c50406"
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stderr",
+ "text": [
+ "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "======================================================================\n",
+ "ERROR: runTest (__main__.test_alpha..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 187, in runTest\n",
+ " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n",
+ " ^^^^^^^^^^^^^^\n",
+ " File \"/tmp/ipython-input-3526011609.py\", line 2, in sort_alpha\n",
+ " string.sort(\",\")\n",
+ " ^^^^^^^^^^^\n",
+ "AttributeError: 'str' object has no attribute 'sort'\n",
+ "\n",
+ "----------------------------------------------------------------------\n",
+ "Ran 100 tests in 0.254s\n",
+ "\n",
+ "FAILED (errors=100)\n"
+ ]
+ }
+ ],
+ "source": [
+ "# This will test your function\n",
+ "test_alpha(sort_alpha)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "SV6BL0-q_ZyA"
+ },
+ "source": [
+ "## 12. Write a function to check if a given password is strong (at least 8 characters, at least one lower case, at least one upper case, at least one number and at least one special character). It should output True if strong and False if not."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 167,
+ "metadata": {
+ "id": "hHvq5Wna_ZyC"
+ },
+ "outputs": [],
+ "source": [
+ "def check_pass(password):\n",
+ " for ch in password:\n",
+ " if len(ch) >= 8:\n",
+ " return True\n",
+ " elif ch.isupper():\n",
+ " return True\n",
+ " elif ch.islower:\n",
+ " return True\n",
+ " elif ch.isdigit():\n",
+ " return True\n",
+ " elif ch.isalnum():\n",
+ " return True\n",
+ " else:\n",
+ " return False\n",
+ ""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 168,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "Jru8HBVR_ZyC",
+ "outputId": "c390f380-47b3-4e8d-d60f-41516b079833"
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stderr",
+ "text": [
+ "FFFFFFFF..FFFFF..FF.FFFFF..FFF.F.F.FFFFFFF.FFFF...FFFFFFFFFFFF.F.F.FFFFF..FFF.FFFFF.FFFF.F..FFFFFFF.\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, nE5, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, 4IDsP, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, jshexJ, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, #MbzcPqU, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, bm{ZuA, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, $opyo[, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, u*0imcdxu, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, gc7C0q7n5CGpj, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, 2LTarpq, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, vPecm9, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, pizqvik, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, oC, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, (zdXaeo}, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, iQgPv, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, (4eHBF, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, dtop, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, eBqR%yOgq)SgUL{P, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, oGO{d, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, bziFh1kkwnyr, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, ij, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, eRp1c, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, wjevy, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, ZI0ttvea, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, zS]!fyWwfc]rDi, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, f9, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, iT, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, moWt&U, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, lksd, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, (GY3MCp, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, B6pdGdOzm, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, fZeNzq, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, ^vl1M, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, fzscApmz, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, s0y, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, ldofZSjUkzONR, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, vqmhdOsinf, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, jr, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, dku5t, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, zF, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, V]ist^p, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, o)1rj, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, @s#b]RiloBcXlrf, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, ]m, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, 2gLc, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, gwzxub}vpFj, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, nhW3c3o, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, Pqwz, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, inCgJeqp&Ywkzl, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, x$mYvHykize, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, umJad, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, tf{6I, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, cpadbxjrm$2hn, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, ud, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, mkhHVquAOr, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, 9ux, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, Tz$, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, kXiqjHhOkb(, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, CR5a, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, eiq, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, kkv, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, qiWCwJQuccNX^, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, dxsoslgmb#mc, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, ljdbqzdonl, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, sIfcpUxzsbi, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, ct)yPp, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, qKD, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, ]n6R#t, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, lN, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, tqe, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, swwUxOtoj, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, ynnUoVPRzaUzig, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, e9qB5z, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, #oV, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, al, the output should be False\n",
+ "\n",
+ "======================================================================\n",
+ "FAIL: runTest (__main__.test_pass..TestKnown.runTest)\n",
+ "----------------------------------------------------------------------\n",
+ "Traceback (most recent call last):\n",
+ " File \"/tmp/ipython-input-297967061.py\", line 202, in runTest\n",
+ " self.assertEqual(fn(self.input_), self.output, f\"For this password, {self.input_}, the output should be {self.output}\")\n",
+ "AssertionError: True != False : For this password, sKzh)mqDmr, the output should be False\n",
+ "\n",
+ "----------------------------------------------------------------------\n",
+ "Ran 100 tests in 0.133s\n",
+ "\n",
+ "FAILED (failures=75)\n"
+ ]
+ }
+ ],
+ "source": [
+ "# This will test your function\n",
+ "test_pass(check_pass)"
+ ]
+ }
+ ],
+ "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.13"
+ },
+ "vscode": {
+ "interpreter": {
+ "hash": "aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49"
+ }
+ },
+ "colab": {
+ "provenance": [],
+ "include_colab_link": true
+ }
},
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "On this lab we will put to practice some of the concepts we have learned on this past few days.\n",
- "\n",
- "`NOTE: On this lab you should try to write all the functions yourself using only the most basic of python syntax and without functions such as len, count, sum, max, min, in, etc. Give it a try. ð§ðŧâðŧðĐðŧâðŧ`\n",
- "\n",
- "The cell after each exercise contains a few tests to check if your function works as expected."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "from mod.testing import *\n",
- "import unittest"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## 1. Write a function that returns the greater of two numbers"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "def greater(a,b):\n",
- "#your code here"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# This will test your function \n",
- "test_greater(greater)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "#your code here"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## 2. Now write a function that returns the largest element on a list"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "#your code here"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# This will test your function \n",
- "test_greatest(greatest)"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## 3. Write a function that sums all the elements on a list"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "def sum_all(lst):\n",
- "#your code here"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {
- "scrolled": true
- },
- "outputs": [],
- "source": [
- "# This will test your function \n",
- "test_sum(sum_all)"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## 4. Write another function that multiplies all the elements on a list"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "def mult_all(lst):\n",
- "#your code here"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {
- "scrolled": true
- },
- "outputs": [],
- "source": [
- "# This will test your function \n",
- "test_mult(mult_all)"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## 5. Now combine those two ideas and write a function that receives a list and either \"+\" or \"*\" and outputs acordingly"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "def oper_all(arr, oper = \"*\"):\n",
- "#your code here"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# This will test your function \n",
- "test_operations(oper_all)"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## 6. Write a function that returns the factorial of a number."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "def factorial(n):\n",
- "#your code here"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "#factorial formula\n",
- "#n! = n * ( n - 1 ) *...*1\n",
- "\n",
- "# This code defines a function called \"factorial\" which takes an input \"n\". The function uses a for loop to iterate through the range of numbers \n",
- "# from 1 to n+1. For each number in that range, it multiplies the current value of x by the number in the range. At the end of the loop, \n",
- "# the function returns the final value of x, which will be the factorial of the input number \"n\".\n",
- "\n",
- "# The Factorial of a positive integer n is the product of all positive integers less than or equal to n. \n",
- "# For example, the factorial of 6 (written \"6!\") is 6 * 5 * 4 * 3 * 2 * 1 = 720.\n",
- "\n",
- "# So this function takes an input of any positive integer, and returns the factorial of that number."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# This will test your function \n",
- "test_factorial(factorial)"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## 7. Write a function that takes a list and returns a list of the unique values.\n",
- "\n",
- "`NOTE: You cannot use set. ðĪ`"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "def unique(lst_un):\n",
- "#your code here"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# This will test your function \n",
- "test_unique(unique)"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## 8. Write a function that returns the mode of a list, i.e.: the element that appears the most times.\n",
- "`NOTE: You should not use count... ð§`"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "def mode_counter(arr):\n",
- "#your code here"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# This will test your function \n",
- "test_mode(mode_counter)"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## 9. Write a function that calculates the standard deviation of a list.\n",
- "`NOTE: Do not use any libraries or already built functions. ð`"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "def st_dev(list_sd):\n",
- "#your code here"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# This will test your function \n",
- "test_stdev(st_dev)"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## 10. Write a function to check if a string is a pangram, i.e.: if it contains all the letters of the alphabet at least once. Mind that the strings may contain characters that are not letters."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "def pangram(string):\n",
- "#your code here"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# This will test your function \n",
- "test_pangram(pangram)"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## 11. Write a function that receives a string of comma separated words and returns a string of comma separated words sorted alphabetically.\n",
- "\n",
- "`NOTE: You may use sorted but not split and definitely no join! ðĪŠ`"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "def sort_alpha(string):\n",
- "#your code here"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# This will test your function \n",
- "test_alpha(sort_alpha)"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## 12. Write a function to check if a given password is strong (at least 8 characters, at least one lower case, at least one upper case, at least one number and at least one special character). It should output True if strong and False if not."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "def check_pass(password):\n",
- "#your code here"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# This will test your function \n",
- "test_pass(check_pass)"
- ]
- }
- ],
- "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.13"
- },
- "vscode": {
- "interpreter": {
- "hash": "aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49"
- }
- }
- },
- "nbformat": 4,
- "nbformat_minor": 4
-}
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
\ No newline at end of file
|