From d50c5e0c9a083e09f7d6c882120af85cb9df9fb3 Mon Sep 17 00:00:00 2001 From: hugocodesdude Date: Thu, 6 Oct 2022 18:55:49 +0200 Subject: [PATCH] files updated --- .ipynb_checkpoints/main-checkpoint.ipynb | 1275 ++++++++++++++++++++++ main.ipynb | 984 ++++++++++++++++- mod/__pycache__/testing.cpython-39.pyc | Bin 0 -> 13228 bytes 3 files changed, 2212 insertions(+), 47 deletions(-) create mode 100644 .ipynb_checkpoints/main-checkpoint.ipynb create mode 100644 mod/__pycache__/testing.cpython-39.pyc diff --git a/.ipynb_checkpoints/main-checkpoint.ipynb b/.ipynb_checkpoints/main-checkpoint.ipynb new file mode 100644 index 0000000..cc478a0 --- /dev/null +++ b/.ipynb_checkpoints/main-checkpoint.ipynb @@ -0,0 +1,1275 @@ +{ + "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": 8, + "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": 10, + "metadata": {}, + "outputs": [], + "source": [ + "def greater(a,b):\n", + " \n", + " if a > b: \n", + " return a\n", + " else:\n", + " return b\n", + " \n" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.070s\n", + "\n", + "OK\n" + ] + } + ], + "source": [ + "# This will test your function \n", + "test_greater(greater)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# I used 'if' with a > to distingush between two elements. With return option 1 or ELSE return option 2" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 2. Now write a function that returns the largest element on a list" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [], + "source": [ + "def greatest(arr):\n", + " \n", + " biggest = arr[0]\n", + " \n", + " for largest in arr:\n", + " if largest > biggest:\n", + " biggest = largest\n", + " \n", + " return biggest\n", + " \n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.069s\n", + "\n", + "OK\n" + ] + } + ], + "source": [ + "# This will test your function \n", + "test_greatest(greatest)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# determine the largest element within the list (arr)\n", + "# scan list via a loop for the greatest element " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 3. Write a function that sums all the elements on a list" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [], + "source": [ + "def sum_all(arr):\n", + " max_sum = 0\n", + " for i in arr:\n", + " max_sum =+1\n", + " \n", + " return max_sum" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.075s\n", + "\n", + "OK\n" + ] + } + ], + "source": [ + "# This will test your function \n", + "test_sum(sum_all)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# without using sum\n", + "# we want to accumulate all the values in the list \n", + "# create an empty variable \n", + "# create a FOR LOOP that scans the list \n", + "# for every value, add them together via =+ command\n", + "# RETURN the variable " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 4. Write another function that multiplies all the elements on a list" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [], + "source": [ + "def mult_all(arr):\n", + " max_multi = 0\n", + " for i in arr:\n", + " max_multi *= i\n", + " \n", + " return max_multi" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "..F....F.FF.F..........F.....FF.....F..........F..................F.F........F.F.....F...F...F.....F\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != -3628652618465280000000 : Should be -3628652618465280000000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != 4572288 : Should be 4572288\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != 33600000 : Should be 33600000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != -5200847356941806705049600000 : Should be -5200847356941806705049600000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != -34836480000 : Should be -34836480000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != -17606594407001859015431900812667781120000000000 : Should be -17606594407001859015431900812667781120000000000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != 21946982400000 : Should be 21946982400000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != -44442639360000 : Should be -44442639360000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != -1260000 : Should be -1260000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != 270950400 : Should be 270950400\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != 63700992 : Should be 63700992\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != 101583175680000000 : Should be 101583175680000000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != -1133100908697864105634037760000000000000000000 : Should be -1133100908697864105634037760000000000000000000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != 50789524970134831104000000000000 : Should be 50789524970134831104000000000000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != 5079158784000000000000 : Should be 5079158784000000000000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != -12084137874856744058880000000 : Should be -12084137874856744058880000000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != 705571342479360000000 : Should be 705571342479360000000\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != 1274259355729920000 : Should be 1274259355729920000\n", + "\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.079s\n", + "\n", + "FAILED (failures=18)\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": 39, + "metadata": {}, + "outputs": [], + "source": [ + "def oper_all(arr, oper):\n", + " \n", + " if oper == \"+\":\n", + " max_sum = 0\n", + " for i in arr:\n", + " max_sum =+1\n", + " return max_sum\n", + " elif oper == \"*\":\n", + " max_multi = 0\n", + " for i in arr:\n", + " max_multi *= i\n", + " \n", + " return max_multi" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....F..F..F...FFF.F.F..FFFF.F.F..FF..FFFFF.F.F.FFF....F.F..F.FF.FFF..FF.F..FFFF.FFFF.F.FF......F.F.F\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 6 : Should be 6\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 7 : Should be 7\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != -202065037149450944290700132352000 : Should be -202065037149450944290700132352000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -17 : Should be -17\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 64 : Should be 64\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 79 : Should be 79\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 66 : Should be 66\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != 1175683448382750720000 : Should be 1175683448382750720000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -1 : Should be -1\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -32 : Should be -32\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -15 : Should be -15\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 54 : Should be 54\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -45 : Should be -45\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -67 : Should be -67\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 26 : Should be 26\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -9 : Should be -9\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -59 : Should be -59\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -84 : Should be -84\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -9 : Should be -9\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 3 : Should be 3\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -3 : Should be -3\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 29 : Should be 29\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 4 : Should be 4\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 29 : Should be 29\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -4 : Should be -4\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 63 : Should be 63\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 120 : Should be 120\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 59 : Should be 59\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -10 : Should be -10\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != -16241081303807464015134720000000000000 : Should be -16241081303807464015134720000000000000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 3 : Should be 3\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -105 : Should be -105\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -93 : Should be -93\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -23 : Should be -23\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 18 : Should be 18\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -19 : Should be -19\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -24 : Should be -24\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 77 : Should be 77\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -54 : Should be -54\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 12 : Should be 12\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -15 : Should be -15\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 35 : Should be 35\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 52 : Should be 52\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -53 : Should be -53\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 75 : Should be 75\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != -3265920000 : Should be -3265920000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -19 : Should be -19\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -47 : Should be -47\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -27 : Should be -27\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 72 : Should be 72\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -23 : Should be -23\n", + "\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.086s\n", + "\n", + "FAILED (failures=51)\n" + ] + } + ], + "source": [ + "# This will test your function \n", + "test_operations(oper_all)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# combine " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 6. Write a function that returns the factorial of a number." + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n" + ] + } + ], + "source": [ + "def factorial(n):\n", + " if n == 0:\n", + " return 1\n", + " else:\n", + " return n * factorial(n-1)\n", + "print(factorial)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "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_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": 66, + "metadata": {}, + "outputs": [], + "source": [ + "def unique(arr):\n", + " \n", + " unique_list = [] \n", + " for i in arr:\n", + " if i not in unique_list:\n", + " unique_list.append(i)\n", + " \n", + " return unique_list\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": 67, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.121s\n", + "\n", + "OK\n" + ] + } + ], + "source": [ + "# This will test your function \n", + "test_unique(unique)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 8. Write a function that returns the mode of a list, i.e.: the element that appears the most times.\n", + "`NOTE: You should not use count... 🧐`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# create a new empty list \n", + "# a FOR LOOP to scan the list for the values \n", + "# without using count " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "[3, 4, 5, 6, 3, 3, 3]\n", + "\n", + "key, value\n", + "3 4\n", + "4 1\n", + "5 1\n", + "6 1" + ] + }, + { + "cell_type": "code", + "execution_count": 113, + "metadata": {}, + "outputs": [], + "source": [ + "def mode_counter(arr):\n", + " mode_list={}\n", + " for w in arr:\n", + " if w in mode_list:\n", + " mode_list[w]+=1\n", + " else:\n", + " mode_list[w]=1\n", + " mode_list=mode_list.items()\n", + " mode=0\n", + " result=\"\"\n", + " for word in mode_list:\n", + " if word[1]>mode:\n", + " mode=word[1]\n", + " if mode==word[1]:\n", + " result=word[0]\n", + " return(result)" + ] + }, + { + "cell_type": "code", + "execution_count": 114, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.084s\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": 77, + "metadata": {}, + "outputs": [], + "source": [ + "from statistics import stdev\n", + "def st_dev(arr):\n", + " return stdev(arr)" + ] + }, + { + "cell_type": "code", + "execution_count": 78, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.102s\n", + "\n", + "OK\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": 115, + "metadata": {}, + "outputs": [], + "source": [ + "def pangram(string):\n", + " alphab = \"abcdefghijklmnopqrstuvwxyz\"\n", + " for a in alphab:\n", + " if a not in string.lower():\n", + " return False\n", + " return True" + ] + }, + { + "cell_type": "code", + "execution_count": 116, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "..............................\n", + "----------------------------------------------------------------------\n", + "Ran 30 tests in 0.020s\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": null, + "metadata": {}, + "outputs": [], + "source": [ + "# TA Hugo's brain is overheatting, how is this possible without split? \n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "def sort_alpha(string):\n", + " list_string = string.splitt(\",\")\n", + " \n", + " list_string = sorted(list_string)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# This will test your function \n", + "test_alpha(sort_alpha)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 12. Write a function to check if a given password is strong (at least 8 characters, at least one lower case, at least one upper case, at least one number and at least one special character). It should output True if strong and False if not.\n", + "`Valid special characters: # @ ! $ % & ( ) ^ * [ ] { }`" + ] + }, + { + "cell_type": "code", + "execution_count": 101, + "metadata": {}, + "outputs": [], + "source": [ + "#Is it possible without len? if so, how? \n", + "\n", + "\n", + "def check_pass(string):\n", + " \n", + " l, u, p, d = 0, 0, 0, 0\n", + " capitalalphabets=\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n", + " smallalphabets=\"abcdefghijklmnopqrstuvwxyz\"\n", + " specialchar=\"#@!$%&()^*[]{}\"\n", + " digits=\"0123456789\"\n", + " if (len(string) >= 8):\n", + " for i in string:\n", + " if (i in smallalphabets):\n", + " l+=1 \n", + " if (i in capitalalphabets):\n", + " u+=1 \n", + " if (i in digits):\n", + " d+=1 \n", + " if(i in specialchar):\n", + " p+=1 \n", + " if (l>=1 and u>=1 and p>=1 and d>=1 and l+p+u+d==len(string)):\n", + " return True\n", + " else:\n", + " return False" + ] + }, + { + "cell_type": "code", + "execution_count": 102, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.072s\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.12" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/main.ipynb b/main.ipynb index 73f285a..cc478a0 100644 --- a/main.ipynb +++ b/main.ipynb @@ -20,7 +20,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": {}, "outputs": [], "source": [ @@ -37,24 +37,50 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "def greater(a,b):\n", - " pass" + " \n", + " if a > b: \n", + " return a\n", + " else:\n", + " return b\n", + " \n" ] }, { "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.070s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_greater(greater)" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# I used 'if' with a > to distingush between two elements. With return option 1 or ELSE return option 2" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -64,24 +90,55 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 20, "metadata": {}, "outputs": [], "source": [ "def greatest(arr):\n", - " pass" + " \n", + " biggest = arr[0]\n", + " \n", + " for largest in arr:\n", + " if largest > biggest:\n", + " biggest = largest\n", + " \n", + " return biggest\n", + " \n", + " " ] }, { "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.069s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_greatest(greatest)" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# determine the largest element within the list (arr)\n", + "# scan list via a loop for the greatest element " + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -91,24 +148,54 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 25, "metadata": {}, "outputs": [], "source": [ "def sum_all(arr):\n", - " pass" + " max_sum = 0\n", + " for i in arr:\n", + " max_sum =+1\n", + " \n", + " return max_sum" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 24, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.075s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_sum(sum_all)" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# without using sum\n", + "# we want to accumulate all the values in the list \n", + "# create an empty variable \n", + "# create a FOR LOOP that scans the list \n", + "# for every value, add them together via =+ command\n", + "# RETURN the variable " + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -118,19 +205,185 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 30, "metadata": {}, "outputs": [], "source": [ "def mult_all(arr):\n", - " pass" + " max_multi = 0\n", + " for i in arr:\n", + " max_multi *= i\n", + " \n", + " return max_multi" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 31, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "..F....F.FF.F..........F.....FF.....F..........F..................F.F........F.F.....F...F...F.....F\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != -3628652618465280000000 : Should be -3628652618465280000000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != 4572288 : Should be 4572288\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != 33600000 : Should be 33600000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != -5200847356941806705049600000 : Should be -5200847356941806705049600000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != -34836480000 : Should be -34836480000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != -17606594407001859015431900812667781120000000000 : Should be -17606594407001859015431900812667781120000000000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != 21946982400000 : Should be 21946982400000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != -44442639360000 : Should be -44442639360000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != -1260000 : Should be -1260000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != 270950400 : Should be 270950400\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != 63700992 : Should be 63700992\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != 101583175680000000 : Should be 101583175680000000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != -1133100908697864105634037760000000000000000000 : Should be -1133100908697864105634037760000000000000000000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != 50789524970134831104000000000000 : Should be 50789524970134831104000000000000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != 5079158784000000000000 : Should be 5079158784000000000000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != -12084137874856744058880000000 : Should be -12084137874856744058880000000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != 705571342479360000000 : Should be 705571342479360000000\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mult..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 63, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != 1274259355729920000 : Should be 1274259355729920000\n", + "\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.079s\n", + "\n", + "FAILED (failures=18)\n" + ] + } + ], "source": [ "# This will test your function \n", "test_mult(mult_all)" @@ -145,24 +398,476 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 39, "metadata": {}, "outputs": [], "source": [ "def oper_all(arr, oper):\n", - " pass" + " \n", + " if oper == \"+\":\n", + " max_sum = 0\n", + " for i in arr:\n", + " max_sum =+1\n", + " return max_sum\n", + " elif oper == \"*\":\n", + " max_multi = 0\n", + " for i in arr:\n", + " max_multi *= i\n", + " \n", + " return max_multi" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 40, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....F..F..F...FFF.F.F..FFFF.F.F..FF..FFFFF.F.F.FFF....F.F..F.FF.FFF..FF.F..FFFF.FFFF.F.FF......F.F.F\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 6 : Should be 6\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 7 : Should be 7\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != -202065037149450944290700132352000 : Should be -202065037149450944290700132352000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -17 : Should be -17\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 64 : Should be 64\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 79 : Should be 79\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 66 : Should be 66\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != 1175683448382750720000 : Should be 1175683448382750720000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -1 : Should be -1\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -32 : Should be -32\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -15 : Should be -15\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 54 : Should be 54\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -45 : Should be -45\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -67 : Should be -67\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 26 : Should be 26\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -9 : Should be -9\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -59 : Should be -59\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -84 : Should be -84\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -9 : Should be -9\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 3 : Should be 3\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -3 : Should be -3\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 29 : Should be 29\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 4 : Should be 4\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 29 : Should be 29\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -4 : Should be -4\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 63 : Should be 63\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 120 : Should be 120\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 59 : Should be 59\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -10 : Should be -10\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != -16241081303807464015134720000000000000 : Should be -16241081303807464015134720000000000000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 3 : Should be 3\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -105 : Should be -105\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -93 : Should be -93\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -23 : Should be -23\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 18 : Should be 18\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -19 : Should be -19\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -24 : Should be -24\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 77 : Should be 77\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -54 : Should be -54\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 12 : Should be 12\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -15 : Should be -15\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 35 : Should be 35\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 52 : Should be 52\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -53 : Should be -53\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 75 : Should be 75\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 0 != -3265920000 : Should be -3265920000\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -19 : Should be -19\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -47 : Should be -47\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -27 : Should be -27\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != 72 : Should be 72\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_operations..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"/Users/hugosaccount/Desktop/IronHack/Labs/lab-functions/mod/testing.py\", line 78, in runTest\n", + " self.assertEqual(fn(*self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: 1 != -23 : Should be -23\n", + "\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.086s\n", + "\n", + "FAILED (failures=51)\n" + ] + } + ], "source": [ "# This will test your function \n", "test_operations(oper_all)" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# combine " + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -172,19 +877,43 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 47, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n" + ] + } + ], "source": [ "def factorial(n):\n", - " pass" + " if n == 0:\n", + " return 1\n", + " else:\n", + " return n * factorial(n-1)\n", + "print(factorial)\n" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 48, "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_factorial(factorial)" @@ -201,24 +930,52 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 66, "metadata": {}, "outputs": [], "source": [ "def unique(arr):\n", - " pass" + " \n", + " unique_list = [] \n", + " for i in arr:\n", + " if i not in unique_list:\n", + " unique_list.append(i)\n", + " \n", + " return unique_list\n", + " " ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 67, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.121s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_unique(unique)" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# " + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -233,8 +990,9 @@ "metadata": {}, "outputs": [], "source": [ - "def mode_counter(arr):\n", - " pass" + "# create a new empty list \n", + "# a FOR LOOP to scan the list for the values \n", + "# without using count " ] }, { @@ -242,6 +1000,57 @@ "execution_count": null, "metadata": {}, "outputs": [], + "source": [ + "[3, 4, 5, 6, 3, 3, 3]\n", + "\n", + "key, value\n", + "3 4\n", + "4 1\n", + "5 1\n", + "6 1" + ] + }, + { + "cell_type": "code", + "execution_count": 113, + "metadata": {}, + "outputs": [], + "source": [ + "def mode_counter(arr):\n", + " mode_list={}\n", + " for w in arr:\n", + " if w in mode_list:\n", + " mode_list[w]+=1\n", + " else:\n", + " mode_list[w]=1\n", + " mode_list=mode_list.items()\n", + " mode=0\n", + " result=\"\"\n", + " for word in mode_list:\n", + " if word[1]>mode:\n", + " mode=word[1]\n", + " if mode==word[1]:\n", + " result=word[0]\n", + " return(result)" + ] + }, + { + "cell_type": "code", + "execution_count": 114, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.084s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_mode(mode_counter)" @@ -257,20 +1066,32 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 77, "metadata": {}, "outputs": [], "source": [ "from statistics import stdev\n", "def st_dev(arr):\n", - " pass" + " return stdev(arr)" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 78, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.102s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_stdev(st_dev)" @@ -285,19 +1106,35 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 115, "metadata": {}, "outputs": [], "source": [ "def pangram(string):\n", - " pass" + " alphab = \"abcdefghijklmnopqrstuvwxyz\"\n", + " for a in alphab:\n", + " if a not in string.lower():\n", + " return False\n", + " return True" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 116, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "..............................\n", + "----------------------------------------------------------------------\n", + "Ran 30 tests in 0.020s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_pangram(pangram)" @@ -312,6 +1149,16 @@ "`NOTE: You may use sorted but not split and definitely no join! ðŸĪŠ`" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# TA Hugo's brain is overheatting, how is this possible without split? \n", + " " + ] + }, { "cell_type": "code", "execution_count": null, @@ -319,7 +1166,9 @@ "outputs": [], "source": [ "def sort_alpha(string):\n", - " pass" + " list_string = string.splitt(\",\")\n", + " \n", + " list_string = sorted(list_string)" ] }, { @@ -342,28 +1191,69 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 101, "metadata": {}, "outputs": [], "source": [ + "#Is it possible without len? if so, how? \n", + "\n", + "\n", "def check_pass(string):\n", - " pass" + " \n", + " l, u, p, d = 0, 0, 0, 0\n", + " capitalalphabets=\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n", + " smallalphabets=\"abcdefghijklmnopqrstuvwxyz\"\n", + " specialchar=\"#@!$%&()^*[]{}\"\n", + " digits=\"0123456789\"\n", + " if (len(string) >= 8):\n", + " for i in string:\n", + " if (i in smallalphabets):\n", + " l+=1 \n", + " if (i in capitalalphabets):\n", + " u+=1 \n", + " if (i in digits):\n", + " d+=1 \n", + " if(i in specialchar):\n", + " p+=1 \n", + " if (l>=1 and u>=1 and p>=1 and d>=1 and l+p+u+d==len(string)):\n", + " return True\n", + " else:\n", + " return False" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 102, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.072s\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 +1267,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.6" + "version": "3.9.12" } }, "nbformat": 4, diff --git a/mod/__pycache__/testing.cpython-39.pyc b/mod/__pycache__/testing.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d84852b981c045eb3f6d6837a38dbdbbc8ccd8b1 GIT binary patch literal 13228 zcmds8TWlOx8J;tl!sR8Ga%VWfGi|l00|-S0=yu>11~(xD=+vNiH8U&eE&Inx7VH!*Ogdn z&YZcO^Pm5m@4p^f`}Xx~_my_*-b6|>;|aUCetiT2%A^)HfntZD<62mvD~yC#{GcXcf(l8<96Bz zhb=$vI62pww?*Fa?Z%C2rBc6<;7-vA{5+$E>%Tb8DI5k4|1OHxwENn9R?s=)`n?p_ z18tVA7(dVgZB<{>mRVqMV})JQZojmw2eH*SkMa0gTTR!Njpf)9TTOhREg4I(q8=pG zd4;X$Ym8}k&Z4cI;A)u4<(#q;j5NbrS{u3+XMp! zFg{xZuiU9xZW|w%7(s*UEYu5SaR^oM1d1>zs%7F2J@g5{8mpbziTL_A>j|2OvQ@G% z5&gLw_)>MLKA6i<@9K%GIxdN#B}WahT*$1DO)K7=Y|t4FQs0d= z-$w+~deGRBREiCqk`6f7^Y%B70uNvm)23-YKLBWCwd+kdn*!ko3SSj z6E#PuAR@$5RJ4erB@Z>(gjKst*pgA1I<5ps!?txcMwf(E34tf6$qrD6Q@GW!zzE1B zNN&=*L|_r(vv)#KE!D}7H3ePeu3&4Sr7HhbK(WMmLqBoE9}4M zI)0G%N|j55f`8%AYR7vpz4h*foW!$uc|9h9B|eL~>>)HPA=<_(1=GHc7HJG!z&gyt z72NF@_x}~Jo{}8!tEIiiRGQe`rq0H;A!RS&L`$=wrA}@~QzRtOV%#+(i7%iv@kJ_L zqM{Qu;v()nPxrr!qW1J=+FM8wm+(ruU(h57vcbf8D#od30#r=kGBmI{#AoP%Z2K!z zlO4D8Q>xJwL3}fWUdG)`5F()~b5xj2e6b}s9fxqKj1IyPRO07w5-(EGiRdtO(X~p`+`2>%QWPkO-O0tq zTN`BDM?$qAqIN)aUvsQvTz0`4Cg*kB?SM7;n@yAR9xfuAoY#AsoG?M*ne$W;{$)X5 z2BdlaJxzL{N#%tu86Ux;>*;+C>?X)hNS=7`4=w4Z?Y-J0uD3(|{LU0TGT?hTf)R|- zuMv3?0jzc|0%?(8{~9&ATjr>^hSs*n`&;yeRHDiN*lNDJQ2&6P581g**e9YT_Qz0J zVw}zCVkCeRSV0&lKp2J_&{GV6Bj}N((_^^GIijvE zosJM2S~kr9lJu1oe4<#`g3REyRldn}W%Xd%NqSE@u0wKpH);O{khsWoY|9_2y6T_ zTBJ~Hz$ijJi-4P4=Y|Xk8SUX%sfE)qK|vaLXLitv!1jz0c|>o0;h)}~bI~G14mG%W z)px8n>W_FN6(B`ddPRuRy7MEl#3{zKy=M054XMpk9-y1!U0PYjoOaSSO3O%{zrC9~ z(8jnK5Yhp;qXaq9fgLR9P$%ET)5ws!)@2eKJkfw0Ps+F~5>;z@5#Gco(lU|bvY&*{ zizLQbmo&UCh+Ru6y&; zJl=2@>%-($Auwz9w6N6M$7^G6$?@0h%FLqhF8^=dqrV^Q5Z(qw9JZdYWDHk`CHb)q8uPTxoZoI1uI3)b)j0Cc5O2NS1L}e zW@R=h0m=lDU*!iVq8MG+Xrcv3d#gk@Oe*XP!A_Xd(zJ?Gq%lYY$rZMm3KC1kYTp_{ zIBShvFE1hI*^gZ>1E1`!mkRb72z~EsX)w zqLFKt#+&rQunj6U>p5jX<7>+Z_DVap`cqpqw&`z!Hd&+xyHbx~s{VMqf>WCP;H{A_wrLT+R$dn6imq!8)Kq?yB$+a zi-5LWNl6mLoRk~ZuyLj#N9s~!OiGa$NfDk{jY|oVghK}(zbQjr++ye4u5O}H=A`9T zW~{w8Cx1f>r>U%OUQ^~|FJksme*BIotIH2%8up|rlJxjBwbx-9b}XsKlpYV*_--~Q z-UYRr8jLEB#JBKuPZ{)kdMIVk3(}12Vrxt6v`L`0>V~vWDS<3*N9#sKbfa`5D14)& zUBtGP+1;~k6}l>-)gHdDlxOeZd6@7$5!f7i{wl5$v;>*R6HPLMbCPN@(5nn^+3l}z zvmvsu@9zLa)(Ix&aJOUrXzr3Yq{yN$xlxA)TOPvBd-v{G`R2Q7Okto}@d)rFOcE%hQQ zlC1h8HP>5Kb?g;>4(|roK#pD6a{D;hIJ9BB5Tl);0anNg9gtg&b@p4+shj% zYU&mWBp|O+orWL?WI{f2sYcd;B0<(99k1eEiw?DOV{1A#ap^G(%&lcQ(JXDu)2K+c zA8Xi{Tss8ZkHY;Kh5b6JHEhnbzClt%R8U~(7pUGcJzL}NWfcCEK9Ez;@E6*#++ujU z(5Dr$F+v}1E0|kNE32lPt4)jc6q-sWyNt~?6SEodZ%-~~lld7tKbNZrPL$YGbO~k^ znWS$2fTwM#WhI#ro2*jLM^(?nI{bqN?e6zH*O%#Z{Bs9fbea4M`~3j>NwC{L@2jv3 zNpV3*o9?wnTXE!`RPi#^u2V5d1!enW{y_#s1qEir`&1ODAT=Q=Qsa<=k%iPUsf%h` g{UySg#AOQFWe|TO?2wTf#@`5z1F}?CL#g5a0+LUE