diff --git a/.ipynb_checkpoints/main-checkpoint.ipynb b/.ipynb_checkpoints/main-checkpoint.ipynb new file mode 100644 index 0000000..303bf11 --- /dev/null +++ b/.ipynb_checkpoints/main-checkpoint.ipynb @@ -0,0 +1,1737 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Functions" + ] + }, + { + "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": 4, + "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": 2, + "metadata": {}, + "outputs": [], + "source": [ + "def greater(a,b):\n", + " return a if a>b else b" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.101s\n", + "\n", + "OK\n" + ] + } + ], + "source": [ + "# This will test your function \n", + "test_greater(greater)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 2. Now write a function that returns the largest element on a list" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "def greatest(arr):\n", + " largest = 0\n", + " for num in arr:\n", + " if num > largest:\n", + " largest = num\n", + " return largest" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.086s\n", + "\n", + "OK\n" + ] + } + ], + "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": 8, + "metadata": {}, + "outputs": [], + "source": [ + "def sum_all(arr):\n", + " total = 0\n", + " for num in arr:\n", + " total += num\n", + " return total" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.088s\n", + "\n", + "OK\n" + ] + } + ], + "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": 10, + "metadata": {}, + "outputs": [], + "source": [ + "def mult_all(arr):\n", + " total = 1\n", + " for num in arr:\n", + " total *= num\n", + " return total" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.092s\n", + "\n", + "OK\n" + ] + } + ], + "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": 14, + "metadata": {}, + "outputs": [], + "source": [ + "def oper_all(arr, oper):\n", + " if (oper=='+'):\n", + " total = 0\n", + " for num in arr:\n", + " total += num\n", + " else:\n", + " total = 1\n", + " for num in arr:\n", + " total *= num\n", + " return total" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.083s\n", + "\n", + "OK\n" + ] + } + ], + "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": 18, + "metadata": {}, + "outputs": [], + "source": [ + "def factorial(n):\n", + " factorial = 1\n", + " for num in range(1, n+1):\n", + " factorial *= num\n", + " return factorial" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.095s\n", + "\n", + "OK\n" + ] + } + ], + "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": 20, + "metadata": {}, + "outputs": [], + "source": [ + "def unique(arr):\n", + " unique = []\n", + " for value in arr:\n", + " if value not in unique:\n", + " unique.append(value)\n", + " return unique" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.180s\n", + "\n", + "OK\n" + ] + } + ], + "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": 101, + "metadata": {}, + "outputs": [], + "source": [ + "def mode_counter(arr): \n", + " arr.sort()\n", + " \n", + " # I run a for loop where I count the amount of times each number apears and I apend said number and the value obtained as \n", + " # a nested list called counter_list\n", + " counter_list = []\n", + " last = arr[0]\n", + " counter = 0\n", + " for num in arr:\n", + " if num == last:\n", + " counter+=1\n", + " else:\n", + " counter_list.append([last,counter])\n", + " counter = 1\n", + " last = num\n", + " counter_list.append([num,counter])\n", + " \n", + " # I sort the counter_list descending and taking using as a key the counter of times each number has appeared\n", + " # and return de number in the first position, as that is the mode in the given array\n", + " return sorted(counter_list, key = lambda x: x[1], reverse=True)[0][0]" + ] + }, + { + "cell_type": "code", + "execution_count": 102, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "8" + ] + }, + "execution_count": 102, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mode_counter([1,1,1,1,1,3,3,3,3,4,5,5,5,5,56,6,6,6,6,6,67,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,10,10,10,12])" + ] + }, + { + "cell_type": "code", + "execution_count": 103, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.101s\n", + "\n", + "OK\n" + ] + } + ], + "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": 28, + "metadata": {}, + "outputs": [], + "source": [ + "from statistics import stdev" + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "metadata": {}, + "outputs": [], + "source": [ + "def variance(arr):\n", + " # calculate the mean of arr\n", + " population = 0\n", + " sum_population = 0\n", + " for num in arr:\n", + " sum_population += num\n", + " population += 1\n", + " mean = sum_population//population \n", + " \n", + " # calculate de deviation of each element -> (element - mean)^2\n", + " list_of_deviations = []\n", + " for num in arr:\n", + " list_of_deviations.append((num-mean)**2)\n", + " print(\"Deviations: \", list_of_deviations)\n", + " \n", + " # calculate de variance -> (sum of deviations / #elements)\n", + " sum_deviations = 0\n", + " for dev in list_of_deviations:\n", + " sum_deviations += dev\n", + " variance = sum_deviations/population\n", + " print(\"Variance: \", variance)\n", + " \n", + " # calculate standard deviation -> sqr(variance)\n", + " st_dev = variance**(1/2)\n", + " print(\"Std deviation: \", st_dev)\n", + " return st_dev" + ] + }, + { + "cell_type": "code", + "execution_count": 65, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Deviations: [9, 1, 1, 1, 0, 0, 4, 16]\n", + "Variance: 4.0\n", + "Std deviation: 2.0\n" + ] + } + ], + "source": [ + "x = variance([2,4,4,4,5,5,7,9])" + ] + }, + { + "cell_type": "code", + "execution_count": 104, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.135s\n", + "\n", + "FAILED (errors=100)\n" + ] + } + ], + "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": 70, + "metadata": {}, + "outputs": [], + "source": [ + "def pangram(string):\n", + " alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n", + " counter = 0\n", + " for letter in alphabet:\n", + " if letter not in string.lower():\n", + " return False\n", + " return True" + ] + }, + { + "cell_type": "code", + "execution_count": 71, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "..............................\n", + "----------------------------------------------------------------------\n", + "Ran 30 tests in 0.032s\n", + "\n", + "OK\n" + ] + } + ], + "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": 96, + "metadata": {}, + "outputs": [], + "source": [ + "def sort_alpha(string):\n", + " words = []\n", + " new_word = \"\"\n", + " for char in string:\n", + " if char == ',':\n", + " words.append(new_word)\n", + " new_word = \"\"\n", + " else:\n", + " new_word+=char\n", + " words.append(new_word)\n", + " \n", + " words = sorted(words)\n", + " \n", + " new_string = \"\"\n", + " for word in words:\n", + " new_string += word\n", + " new_string += ','\n", + " return new_string[0:-1]" + ] + }, + { + "cell_type": "code", + "execution_count": 97, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.087s\n", + "\n", + "OK\n" + ] + } + ], + "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.\n", + "`Valid special characters: # @ ! $ % & ( ) ^ * [ ] { }`" + ] + }, + { + "cell_type": "code", + "execution_count": 124, + "metadata": {}, + "outputs": [], + "source": [ + "def check_pass(string):\n", + " list_chars = ['#', '@', '!', '$', '%', '&', '(', ')', '^', '*', '[', ']', '{', '}']\n", + " list_numbers = \"0123456789\"\n", + " counter = 0\n", + " \n", + " length = False\n", + " lower = False\n", + " upper = False\n", + " number = False\n", + " special = False\n", + " \n", + " for char in string:\n", + " counter+=1\n", + " if (char.islower()):\n", + " lower = True\n", + " elif (char.isupper()):\n", + " upper = True\n", + " elif (char in list_chars):\n", + " special = True\n", + " elif (char in list_numbers):\n", + " number = True\n", + " \n", + " if counter >= 8:\n", + " length = True\n", + " \n", + " return length and lower and upper and special and number" + ] + }, + { + "cell_type": "code", + "execution_count": 125, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.081s\n", + "\n", + "OK\n" + ] + } + ], + "source": [ + "# This will test your function \n", + "test_pass(check_pass)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.13" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/main.ipynb b/main.ipynb index 73f285a..303bf11 100644 --- a/main.ipynb +++ b/main.ipynb @@ -20,7 +20,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -37,19 +37,31 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "def greater(a,b):\n", - " pass" + " return a if a>b else b" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.101s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_greater(greater)" @@ -64,19 +76,35 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "def greatest(arr):\n", - " pass" + " largest = 0\n", + " for num in arr:\n", + " if num > largest:\n", + " largest = num\n", + " return largest" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.086s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_greatest(greatest)" @@ -91,19 +119,34 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "def sum_all(arr):\n", - " pass" + " total = 0\n", + " for num in arr:\n", + " total += num\n", + " return total" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.088s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_sum(sum_all)" @@ -118,19 +161,34 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "def mult_all(arr):\n", - " pass" + " total = 1\n", + " for num in arr:\n", + " total *= num\n", + " return total" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.092s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_mult(mult_all)" @@ -145,19 +203,39 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 14, "metadata": {}, "outputs": [], "source": [ "def oper_all(arr, oper):\n", - " pass" + " if (oper=='+'):\n", + " total = 0\n", + " for num in arr:\n", + " total += num\n", + " else:\n", + " total = 1\n", + " for num in arr:\n", + " total *= num\n", + " return total" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 15, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.083s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_operations(oper_all)" @@ -172,19 +250,34 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 18, "metadata": {}, "outputs": [], "source": [ "def factorial(n):\n", - " pass" + " factorial = 1\n", + " for num in range(1, n+1):\n", + " factorial *= num\n", + " return factorial" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 19, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.095s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_factorial(factorial)" @@ -201,19 +294,35 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 20, "metadata": {}, "outputs": [], "source": [ "def unique(arr):\n", - " pass" + " unique = []\n", + " for value in arr:\n", + " if value not in unique:\n", + " unique.append(value)\n", + " return unique" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 21, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.180s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_unique(unique)" @@ -229,19 +338,69 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 101, "metadata": {}, "outputs": [], "source": [ - "def mode_counter(arr):\n", - " pass" + "def mode_counter(arr): \n", + " arr.sort()\n", + " \n", + " # I run a for loop where I count the amount of times each number apears and I apend said number and the value obtained as \n", + " # a nested list called counter_list\n", + " counter_list = []\n", + " last = arr[0]\n", + " counter = 0\n", + " for num in arr:\n", + " if num == last:\n", + " counter+=1\n", + " else:\n", + " counter_list.append([last,counter])\n", + " counter = 1\n", + " last = num\n", + " counter_list.append([num,counter])\n", + " \n", + " # I sort the counter_list descending and taking using as a key the counter of times each number has appeared\n", + " # and return de number in the first position, as that is the mode in the given array\n", + " return sorted(counter_list, key = lambda x: x[1], reverse=True)[0][0]" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 102, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "8" + ] + }, + "execution_count": 102, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mode_counter([1,1,1,1,1,3,3,3,3,4,5,5,5,5,56,6,6,6,6,6,67,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,10,10,10,12])" + ] + }, + { + "cell_type": "code", + "execution_count": 103, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.101s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_mode(mode_counter)" @@ -257,20 +416,1125 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 28, "metadata": {}, "outputs": [], "source": [ - "from statistics import stdev\n", - "def st_dev(arr):\n", - " pass" + "from statistics import stdev" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 64, "metadata": {}, "outputs": [], + "source": [ + "def variance(arr):\n", + " # calculate the mean of arr\n", + " population = 0\n", + " sum_population = 0\n", + " for num in arr:\n", + " sum_population += num\n", + " population += 1\n", + " mean = sum_population//population \n", + " \n", + " # calculate de deviation of each element -> (element - mean)^2\n", + " list_of_deviations = []\n", + " for num in arr:\n", + " list_of_deviations.append((num-mean)**2)\n", + " print(\"Deviations: \", list_of_deviations)\n", + " \n", + " # calculate de variance -> (sum of deviations / #elements)\n", + " sum_deviations = 0\n", + " for dev in list_of_deviations:\n", + " sum_deviations += dev\n", + " variance = sum_deviations/population\n", + " print(\"Variance: \", variance)\n", + " \n", + " # calculate standard deviation -> sqr(variance)\n", + " st_dev = variance**(1/2)\n", + " print(\"Std deviation: \", st_dev)\n", + " return st_dev" + ] + }, + { + "cell_type": "code", + "execution_count": 65, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Deviations: [9, 1, 1, 1, 0, 0, 4, 16]\n", + "Variance: 4.0\n", + "Std deviation: 2.0\n" + ] + } + ], + "source": [ + "x = variance([2,4,4,4,5,5,7,9])" + ] + }, + { + "cell_type": "code", + "execution_count": 104, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\franc\\OneDrive\\Escritorio\\D4LAB\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " File \"C:\\Users\\franc\\anaconda3\\envs\\Ironhack\\lib\\unittest\\case.py\", line 868, in assertAlmostEqual\n", + " diff = abs(first - second)\n", + "TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'\n", + "\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.135s\n", + "\n", + "FAILED (errors=100)\n" + ] + } + ], "source": [ "# This will test your function \n", "test_stdev(st_dev)" @@ -285,19 +1549,36 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 70, "metadata": {}, "outputs": [], "source": [ "def pangram(string):\n", - " pass" + " alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n", + " counter = 0\n", + " for letter in alphabet:\n", + " if letter not in string.lower():\n", + " return False\n", + " return True" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 71, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "..............................\n", + "----------------------------------------------------------------------\n", + "Ran 30 tests in 0.032s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_pangram(pangram)" @@ -314,19 +1595,47 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 96, "metadata": {}, "outputs": [], "source": [ "def sort_alpha(string):\n", - " pass" + " words = []\n", + " new_word = \"\"\n", + " for char in string:\n", + " if char == ',':\n", + " words.append(new_word)\n", + " new_word = \"\"\n", + " else:\n", + " new_word+=char\n", + " words.append(new_word)\n", + " \n", + " words = sorted(words)\n", + " \n", + " new_string = \"\"\n", + " for word in words:\n", + " new_string += word\n", + " new_string += ','\n", + " return new_string[0:-1]" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 97, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.087s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_alpha(sort_alpha)" @@ -342,28 +1651,71 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 124, "metadata": {}, "outputs": [], "source": [ "def check_pass(string):\n", - " pass" + " list_chars = ['#', '@', '!', '$', '%', '&', '(', ')', '^', '*', '[', ']', '{', '}']\n", + " list_numbers = \"0123456789\"\n", + " counter = 0\n", + " \n", + " length = False\n", + " lower = False\n", + " upper = False\n", + " number = False\n", + " special = False\n", + " \n", + " for char in string:\n", + " counter+=1\n", + " if (char.islower()):\n", + " lower = True\n", + " elif (char.isupper()):\n", + " upper = True\n", + " elif (char in list_chars):\n", + " special = True\n", + " elif (char in list_numbers):\n", + " number = True\n", + " \n", + " if counter >= 8:\n", + " length = True\n", + " \n", + " return length and lower and upper and special and number" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 125, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.081s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_pass(check_pass)" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -377,7 +1729,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.6" + "version": "3.9.13" } }, "nbformat": 4, diff --git a/mod/__pycache__/testing.cpython-39.pyc b/mod/__pycache__/testing.cpython-39.pyc new file mode 100644 index 0000000..3e19615 Binary files /dev/null and b/mod/__pycache__/testing.cpython-39.pyc differ