diff --git a/main.ipynb b/main.ipynb index 2b94ca7..b5ae66a 100644 --- a/main.ipynb +++ b/main.ipynb @@ -20,7 +20,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ @@ -37,19 +37,56 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "def greater(a,b):\n", - " pass" + " if a > b:\n", + " return a\n", + " elif b > a:\n", + " return b\n", + " else:\n", + " return f\"the argument a: {a}, and b: {b}, take the same value\"" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "'the argument a: 4, and b: 4, take the same value'" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "greater(4,4)" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.049s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_greater(greater)" @@ -64,19 +101,94 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 50, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1\n", + "6\n", + "3\n", + "4\n" + ] + } + ], + "source": [ + "list1=[1,6,3,4]\n", + "\n", + "for i in list1:\n", + " print(i)" + ] + }, + { + "cell_type": "code", + "execution_count": 82, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "\"note: the float('-inf') might be the best trick I learned while doing the pre-work, \\nand if I understood it correctly, it takes a fictional value that will always be lower \\n(or higher, depending on what we want) than what we need to compare it to.\"" + ] + }, + "execution_count": 82, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "def greatest(arr):\n", - " pass" + " stored_value_greatest = float('-inf')\n", + " for i in arr:\n", + " if i > stored_value_greatest:\n", + " stored_value_greatest = i\n", + " return stored_value_greatest\n", + "\n", + "\"\"\"note: the float('-inf') might be the best trick I learned while doing the pre-work, \n", + "and if I understood it correctly, it takes a fictional value that will always be lower \n", + "(or higher, depending on what we want) than what we need to compare it to.\"\"\"" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 83, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "8" + ] + }, + "execution_count": 83, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#Ricardo simple test:\n", + "greatest([2,0,8,1,6])" + ] + }, + { + "cell_type": "code", + "execution_count": 81, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.037s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_greatest(greatest)" @@ -91,19 +203,55 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 104, "metadata": {}, "outputs": [], "source": [ "def sum_all(arr):\n", - " pass" + " stored_value_sum = 0\n", + " for i in arr:\n", + " stored_value_sum += i\n", + " return stored_value_sum" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 105, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "8" + ] + }, + "execution_count": 105, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#Ricardo simple test:\n", + "sum_all([2,2,4])" + ] + }, + { + "cell_type": "code", + "execution_count": 106, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.039s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_sum(sum_all)" @@ -118,19 +266,55 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 107, "metadata": {}, "outputs": [], "source": [ "def mult_all(arr):\n", - " pass" + " stored_value_multipython = 1\n", + " for i in arr:\n", + " stored_value_multipython *= i\n", + " return stored_value_multipython" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 108, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "6" + ] + }, + "execution_count": 108, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#Ricardo simple test:\n", + "mult_all([1,2,3])" + ] + }, + { + "cell_type": "code", + "execution_count": 109, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.037s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_mult(mult_all)" @@ -145,19 +329,61 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 113, "metadata": {}, "outputs": [], "source": [ "def oper_all(arr, oper):\n", - " pass" + " if oper == \"+\":\n", + " return sum_all(arr)\n", + " elif oper == \"*\":\n", + " return mult_all(arr)\n", + " \n", + "\"\"\"note to self, unlike the exercise in class, we are defining this function to take 2 arguments (one for the parameter arr, another for oper)\n", + "this means I can't forget to open the parenthesis when calling for the return of the previously defined functions\n", + "inside the definition of oper_all and mention this first parameter. \n", + "When using oper_all I won't neeed to oper_all(this function)(previous functions), I will do all in one\n", + "\n", + "\"\"\"" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 116, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "24" + ] + }, + "execution_count": 116, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "oper_all([1,2,3,4],\"*\")" + ] + }, + { + "cell_type": "code", + "execution_count": 117, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.037s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_operations(oper_all)" @@ -172,19 +398,78 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 123, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[1, 2, 3, 4, 5, 6, 7]\n" + ] + } + ], + "source": [ + "i = 8\n", + "helping_list = list(range(1,i))\n", + "print(helping_list)" + ] + }, + { + "cell_type": "code", + "execution_count": 133, "metadata": {}, "outputs": [], "source": [ "def factorial(n):\n", - " pass" + " stored_factorial = 1\n", + " helping_list = list(range(1,n+1)) \n", + " \"\"\"n+1 cause if it was just n it would stop one iteration before the number we want, \n", + " for example, factorial (3) would give us = 1*1*2 = 2, would ignore the 3 cause 3 ocupies index 2\"\"\"\n", + " \n", + " for i in helping_list:\n", + " stored_factorial *= i\n", + " return stored_factorial" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 135, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "24" + ] + }, + "execution_count": 135, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#Ricardo simple test:\n", + "factorial(4)" + ] + }, + { + "cell_type": "code", + "execution_count": 136, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.038s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_factorial(factorial)" @@ -201,19 +486,84 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 195, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['a', 1, 55, 'teste', 'b']\n" + ] + } + ], + "source": [ + "list2 = [\"a\",1,55,\"teste\",1,\"b\",\"a\"]\n", + "\n", + "helping_list2 = []\n", + "\n", + "helping_list2.append(list2[0])\n", + "for i in list2:\n", + " if i not in helping_list2:\n", + " helping_list2.append(i)\n", + "print(helping_list2)" + ] + }, + { + "cell_type": "code", + "execution_count": 197, "metadata": {}, "outputs": [], "source": [ "def unique(arr):\n", - " pass" + " helping_list_unique = []\n", + " helping_list_unique.append(arr[0])\n", + " for i in arr:\n", + " if i not in helping_list_unique:\n", + " helping_list_unique.append(i)\n", + " return(helping_list_unique)\n", + "\n", + "#note: this function will only work if arr is NOT empty. " ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 163, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "['a', 1, 55, 'teste', 'b']" + ] + }, + "execution_count": 163, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#Ricardo simple test:\n", + "unique([\"a\",1,55,\"teste\",1,\"b\",\"a\"])" + ] + }, + { + "cell_type": "code", + "execution_count": 161, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.087s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_unique(unique)" @@ -232,14 +582,118 @@ "execution_count": null, "metadata": {}, "outputs": [], + "source": [ + "#standard deviation = squared root of:\n", + " # the sum of:\n", + " # the squares of the difference between each i and the average of the population\n", + " # divided by n-1\n", + "#standard deviation = ((sum((i-average(n)))^2)/(n))^(1/2)" + ] + }, + { + "cell_type": "code", + "execution_count": 174, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "counter stdev is 5, sum is 30\n", + "average_array_stdev i 6.0\n", + "squares_of_diffs i 40.0\n", + "2.8284271247461903\n" + ] + } + ], + "source": [ + "list_stdev = [2,4,6,8,10]\n", + "counter_stdev = 0\n", + "sum_list_stdev = 0\n", + "\n", + "for i in list_stdev:\n", + " counter_stdev += 1\n", + " sum_list_stdev += i\n", + "print(f\"counter stdev is {counter_stdev}, sum is {sum_list_stdev}\")\n", + "\n", + "average_array_stdev = sum_list_stdev / counter_stdev\n", + "print(f\"average_array_stdev i {average_array_stdev}\")\n", + "\n", + "squares_of_diffs = 0\n", + "\n", + "for i in list_stdev:\n", + " squares_of_diffs += (i-average_array_stdev)**2\n", + " \n", + "print(f\"squares_of_diffs i {squares_of_diffs}\")\n", + "\n", + "final_result = (squares_of_diffs / (counter_stdev))**(1/2)\n", + "print(final_result)" + ] + }, + { + "cell_type": "code", + "execution_count": 177, + "metadata": {}, + "outputs": [], "source": [ "def st_dev(arr):\n", - " pass" + " # let's first create some helping count of obs and sum of the items in the array\n", + " counter_stdev = 0\n", + " sum_list_stdev = 0\n", + "\n", + " # now let's check how many items we have in the array and what is the actual sum of them\n", + " for i in list_stdev:\n", + " counter_stdev += 1\n", + " sum_list_stdev += i\n", + " \n", + " # vamos calculate the average of the array which is simply the division of the vars we have so far\n", + " average_array_stdev = sum_list_stdev / counter_stdev\n", + "\n", + " # and now create a var to compute the difference between each value in the list and the average of the list\n", + " squares_of_diffs = 0\n", + "\n", + " # let's calculate this mofo:\n", + " for i in list_stdev:\n", + " squares_of_diffs += (i-average_array_stdev)**2\n", + " \n", + " # we are in possession of everything we need to calculate the standard deviation, let's calculate it and return it:\n", + " final_result = (squares_of_diffs / (counter_stdev))**(1/2)\n", + " \n", + " return final_result\n" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 184, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2.581988897471611" + ] + }, + "execution_count": 184, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "st_dev([2,4,6,8])\n", + "from statistics import stdev\n", + "stdev([2,4,6,8])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "[welllll........ Actually I don't know. According to this website, my calc is correct:](https://www.calculator.net/standard-deviation-calculator.html?numberinputs=2%2C4%2C6%2C8%2C10&ctype=p&x=46&y=21)" + ] + }, + { + "cell_type": "code", + "execution_count": 180, "metadata": {}, "outputs": [], "source": [ @@ -261,19 +715,177 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 235, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "'Monthy Python 24' is not a pangram\n", + "The letters ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'i', 'j', 'k', 'l', 'q', 'r', 's', 'u', 'v', 'w', 'x', 'z'] were not found in the string\n", + "the letters ['h', 'm', 'n', 'o', 'p', 't', 'y'] are indeed in the string\n" + ] + } + ], + "source": [ + "alphabet_var = [\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"q\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\"]\n", + "\n", + "string_example = \"Monthy Python 24\"\n", + "\n", + "#print(string_example.lower())\n", + "\n", + "letters_not_in_string=[]\n", + "letters_in_string=[]\n", + "for i in alphabet_var:\n", + " if i not in string_example.lower():\n", + " letters_not_in_string += [i]\n", + " else:\n", + " letters_in_string +=[i]\n", + "\n", + "if letters_not_in_string == []:\n", + " print(f\"'{string_example}' is indeed a pangram\")\n", + "else:\n", + " print(f\"'{string_example}' is not a pangram\")\n", + " \n", + "\n", + "print(f\"The letters {letters_not_in_string} were not found in the string\") \n", + "print(f\"the letters {letters_in_string} are indeed in the string\")\n" + ] + }, + { + "cell_type": "code", + "execution_count": 236, "metadata": {}, "outputs": [], "source": [ "def pangram(string):\n", - " pass" + " #let's first create an alphabet with all the variables:\n", + " alphabet_var = [\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"q\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\"]\n", + " \n", + " #let's now create two variables where we will 1. add the letters present in the string, 2. check the letters not in the string:\n", + " letters_not_in_string=[]\n", + " letters_in_string=[]\n", + " \n", + " #iterating thru all the letters in the alphabet_var to check if they are in the string and to feed the upper 2 variables we've created\n", + " for i in alphabet_var:\n", + " if i not in string.lower():\n", + " letters_not_in_string += [i]\n", + " else:\n", + " letters_in_string +=[i]\n", + " \n", + " #to give the user a final answer, let's tell them if it evaluates to TRUE or FALSE and consider what letters are missing/are in the string\n", + " if letters_not_in_string == []:\n", + " print(f\"'{string}' is indeed a pangram\")\n", + " return True\n", + " else:\n", + " print(f\"'{string}' is not a pangram, \\n The letters {letters_not_in_string} were not found in the string \\n the letters {letters_in_string} are indeed in the string\")\n", + " return False\n", + " \n", + " " ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 233, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "'abc 24' is not a pangram, \n", + " The letters ['d', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] were not found in the string \n", + " the letters ['a', 'b', 'c'] are indeed in the string\n", + "False\n" + ] + } + ], + "source": [ + "print(pangram(\"abc 24\"))" + ] + }, + { + "cell_type": "code", + "execution_count": 234, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "..............................\n", + "----------------------------------------------------------------------\n", + "Ran 30 tests in 0.044s\n", + "\n", + "OK\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "'Waltz, nymph, for quick jigs vex Bud.' is indeed a pangram\n", + "'Sphinx of black quartz, judge my vow.' is indeed a pangram\n", + "'Pack my box with five dozen liquor jugs.' is indeed a pangram\n", + "'Glib jocks quiz nymph to vex dwarf.' is indeed a pangram\n", + "'Jackdaws love my big sphinx of quartz.' is indeed a pangram\n", + "'The five boxing wizards jump quickly.' is indeed a pangram\n", + "'How vexingly quick daft zebras jump!' is indeed a pangram\n", + "'Quick zephyrs blow, vexing daft Jim.' is indeed a pangram\n", + "'Two driven jocks help fax my big quiz.' is indeed a pangram\n", + "'The jay, pig, fox, zebra and my wolves quack!' is indeed a pangram\n", + "'Sympathizing would fix Quaker objectives.' is indeed a pangram\n", + "'A wizard's job is to vex chumps quickly in fog.' is indeed a pangram\n", + "'Watch 'Jeopardy!', Alex Trebek's fun TV quiz game.' is indeed a pangram\n", + "'By Jove, my quick study of lexicography won a prize!' is indeed a pangram\n", + "'Waxy and quivering, jocks fumble the pizza.' is indeed a pangram\n", + "'othysramsbemqqefkkntabofauedudmpxaogqdfkwfobelvsbdroaxtajuggzrxnxmpvni' is not a pangram, \n", + " The letters ['c'] were not found in the string \n", + " the letters ['a', 'b', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] are indeed in the string\n", + "'tfbkbgwimxmvyknvphhdcinapsdpbseggdrkg' is not a pangram, \n", + " The letters ['j', 'l', 'o', 'q', 'u', 'z'] were not found in the string \n", + " the letters ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'k', 'm', 'n', 'p', 'r', 's', 't', 'v', 'w', 'x', 'y'] are indeed in the string\n", + "'aqbgxctkafqbppzthjwgkaxnvkntrl' is not a pangram, \n", + " The letters ['d', 'e', 'i', 'm', 'o', 's', 'u', 'y'] were not found in the string \n", + " the letters ['a', 'b', 'c', 'f', 'g', 'h', 'j', 'k', 'l', 'n', 'p', 'q', 'r', 't', 'v', 'w', 'x', 'z'] are indeed in the string\n", + "'vsfocjnzaovavnpklswvkesepjhrlcqxunpfgcotfowyxvvinwzafvzlmrhlbzpvmjyxpuqykeimeu' is not a pangram, \n", + " The letters ['d'] were not found in the string \n", + " the letters ['a', 'b', 'c', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] are indeed in the string\n", + "'npgpufjzbfqogaeqqsdoxxfdankh' is not a pangram, \n", + " The letters ['c', 'i', 'l', 'm', 'r', 't', 'v', 'w', 'y'] were not found in the string \n", + " the letters ['a', 'b', 'd', 'e', 'f', 'g', 'h', 'j', 'k', 'n', 'o', 'p', 'q', 's', 'u', 'x', 'z'] are indeed in the string\n", + "'qytqvdqpmjvmvnjkitpyqqwkoenlhimwsvyyh' is not a pangram, \n", + " The letters ['a', 'b', 'c', 'f', 'g', 'r', 'u', 'x', 'z'] were not found in the string \n", + " the letters ['d', 'e', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 's', 't', 'v', 'w', 'y'] are indeed in the string\n", + "'oeehoohbcabqvtqtffhtsnipegisfr' is not a pangram, \n", + " The letters ['d', 'j', 'k', 'l', 'm', 'u', 'w', 'x', 'y', 'z'] were not found in the string \n", + " the letters ['a', 'b', 'c', 'e', 'f', 'g', 'h', 'i', 'n', 'o', 'p', 'q', 'r', 's', 't', 'v'] are indeed in the string\n", + "'mkbkamiepfjpflfaqgxvfwzrzlgmfnwcjachcikfgg' is not a pangram, \n", + " The letters ['d', 'o', 's', 't', 'u', 'y'] were not found in the string \n", + " the letters ['a', 'b', 'c', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 'v', 'w', 'x', 'z'] are indeed in the string\n", + "'jkxtirngcircsppbwjrjkncrofhoanlvmhnvllyrtnmvevwzhnwczvkrieuuyvssutsgct' is not a pangram, \n", + " The letters ['d', 'q'] were not found in the string \n", + " the letters ['a', 'b', 'c', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] are indeed in the string\n", + "'qwtploysxpxfctbmdwzygwniwgpvdwdx' is not a pangram, \n", + " The letters ['a', 'e', 'h', 'j', 'k', 'r', 'u'] were not found in the string \n", + " the letters ['b', 'c', 'd', 'f', 'g', 'i', 'l', 'm', 'n', 'o', 'p', 'q', 's', 't', 'v', 'w', 'x', 'y', 'z'] are indeed in the string\n", + "'lgewrtveowlmzlndfghqvwtjmnasxrqevzkibatqkwdxccrorctvrwyfpzcf' is not a pangram, \n", + " The letters ['u'] were not found in the string \n", + " the letters ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'y', 'z'] are indeed in the string\n", + "'fuylwydypqmafjtsmfhulpmmixsavikplxpaqkquycnqduzvxpdasoouyifyanijezonjfsn' is not a pangram, \n", + " The letters ['b', 'g', 'r'] were not found in the string \n", + " the letters ['a', 'c', 'd', 'e', 'f', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] are indeed in the string\n", + "'nkmmashibseioqcaxyjupshjoduwbcllulhxgzommzovcyisblffitevfzerjjyhdheobqlxfmgcasmbjvxvcgvu' is indeed a pangram\n", + "'tvdotecyauesaeopxvsdzqtgjjpvjqrtpobafwxawmitbuwgbsuf' is not a pangram, \n", + " The letters ['h', 'k', 'l', 'n'] were not found in the string \n", + " the letters ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'i', 'j', 'm', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] are indeed in the string\n", + "'ybessmbbqqkzwcufxdprjadhltpzguhsxqdiffwqhv' is not a pangram, \n", + " The letters ['n', 'o'] were not found in the string \n", + " the letters ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] are indeed in the string\n" + ] + } + ], "source": [ "# This will test your function \n", "test_pangram(pangram)" @@ -289,19 +901,233 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 267, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "True\n", + "True True True True True\n" + ] + } + ], + "source": [ + "\"\"\"\n", + "All the conditions we should meet:\n", + "1. count of characters >= 8 \n", + "2. at least (AT LEAST! --> >=) one lower case\n", + "3. at least (AT LEAST! --> >=) one upper case\n", + "4. at least (AT LEAST! --> >=) one number\n", + "5. at least (AT LEAST! --> >=) one of these fellas:\n", + " # @ ! $ % & ( ) ^ * [ ] { }\n", + "6. Return True or false depending on whether it's strong\n", + "\n", + "\"\"\"\n", + "\n", + "special_characters = [\"#\", \"@\", \"!\", \"$\", \"%\", \"&\", \"(\", \")\", \"^\", \"*\", \"[\", \"]\", \"{\", \"}\"]\n", + "numbers_list=[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"0\"]\n", + "\n", + "password_var = \"This is a password!24\"\n", + "\n", + "count_characters = 0\n", + "upper_case_count = 0\n", + "lower_case_count = 0\n", + "numbers_count = 0\n", + "special_chars_count = 0\n", + "\n", + "#1. let's check the lenght and have it return true or false if it meets our condition:\n", + "for i in password_var:\n", + " count_characters += 1\n", + "\n", + "if count_characters >= 8:\n", + " count_characters = True\n", + "else:\n", + " count_characters = False\n", + "\n", + " \n", + "\n", + "#2. let's check how many/if true on the lower case count:\n", + "for i in password_var:\n", + " if i.islower():\n", + " lower_case_count += 1\n", + " \n", + "if lower_case_count >= 1:\n", + " lower_case_count = True\n", + "else:\n", + " lower_case_count = False\n", + "\n", + " \n", + " \n", + "#3. let's check how many/if true on the upper case count:\n", + "for i in password_var:\n", + " if i.isupper():\n", + " upper_case_count += 1\n", + " \n", + "if upper_case_count >= 1:\n", + " upper_case_count = True\n", + "else:\n", + " upper_case_count = False\n", + "\n", + " \n", + "#4. let's check how many/if true on the numbers count:\n", + "for i in numbers_list:\n", + " if i in password_var:\n", + " numbers_count += 1\n", + "\n", + "if numbers_count >= 1:\n", + " numbers_count = True\n", + "else:\n", + " numbers_count = False\n", + " \n", + " \n", + " \n", + "#5. same thing but 4 the special charcs:\n", + "for i in special_characters:\n", + " if i in password_var:\n", + " special_chars_count += 1\n", + "\n", + "if special_chars_count >= 1:\n", + " special_chars_count = True\n", + "else:\n", + " special_chars_count = False\n", + "\n", + "if count_characters and lower_case_count and upper_case_count and numbers_count and special_chars_count == True:\n", + " print(\"True\")\n", + "\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 270, "metadata": {}, "outputs": [], "source": [ "def check_pass(string):\n", - " pass" + " \"\"\"\n", + "All the conditions we should meet:\n", + "1. count of characters >= 8 \n", + "2. at least (AT LEAST! --> >=) one lower case\n", + "3. at least (AT LEAST! --> >=) one upper case\n", + "4. at least (AT LEAST! --> >=) one number\n", + "5. at least (AT LEAST! --> >=) one of these fellas:\n", + " # @ ! $ % & ( ) ^ * [ ] { }\n", + "6. Return True or false depending on whether it's strong\n", + "\"\"\"\n", + "\n", + " special_characters = [\"#\", \"@\", \"!\", \"$\", \"%\", \"&\", \"(\", \")\", \"^\", \"*\", \"[\", \"]\", \"{\", \"}\"]\n", + " numbers_list=[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"0\"]\n", + "\n", + "\n", + " count_characters = 0\n", + " upper_case_count = 0\n", + " lower_case_count = 0\n", + " numbers_count = 0\n", + " special_chars_count = 0\n", + "\n", + " #1. let's check the lenght and have it return true or false if it meets our condition:\n", + " for i in string:\n", + " count_characters += 1\n", + "\n", + " if count_characters >= 8:\n", + " count_characters = True\n", + " else:\n", + " count_characters = False\n", + "\n", + " \n", + "\n", + " #2. let's check how many/if true on the lower case count:\n", + " for i in string:\n", + " if i.islower():\n", + " lower_case_count += 1\n", + " \n", + " if lower_case_count >= 1:\n", + " lower_case_count = True\n", + " else:\n", + " lower_case_count = False\n", + "\n", + " \n", + " \n", + " #3. let's check how many/if true on the upper case count:\n", + " for i in string:\n", + " if i.isupper():\n", + " upper_case_count += 1\n", + " \n", + " if upper_case_count >= 1:\n", + " upper_case_count = True\n", + " else:\n", + " upper_case_count = False\n", + "\n", + " \n", + " #4. let's check how many/if true on the numbers count:\n", + " for i in numbers_list:\n", + " if i in string:\n", + " numbers_count += 1\n", + "\n", + " if numbers_count >= 1:\n", + " numbers_count = True\n", + " else:\n", + " numbers_count = False\n", + " \n", + " \n", + " \n", + " #5. same thing but for the special charcs:\n", + " for i in special_characters:\n", + " if i in string:\n", + " special_chars_count += 1\n", + "\n", + " if special_chars_count >= 1:\n", + " special_chars_count = True\n", + " else:\n", + " special_chars_count = False\n", + "\n", + " if count_characters and lower_case_count and upper_case_count and numbers_count and special_chars_count == True:\n", + " return True\n", + " else:\n", + " return False" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 273, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 273, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "check_pass(\"This is a password!24\")" + ] + }, + { + "cell_type": "code", + "execution_count": 274, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.090s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_pass(check_pass)" @@ -324,24 +1150,960 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 293, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{1: 2, 3: 6, 4: 3, 5: 2, 6: 1, 2: 4, 'hi': 11}\n", + "hi 11\n" + ] + } + ], + "source": [ + "#THIS IS JUST MY TEST, THE CODE CAN BE FOUND IN THE CELL BELOW AND IS WORKING(!!!)\n", + "\n", + "list_mode1 = [1,1,3,4,5,3,4,6,3,3,2,2,3,5,2,2,3,4,\"hi\",\"hi\",\"hi\",\"hi\",\"hi\",\"hi\",\"hi\",\"hi\",\"hi\",\"hi\",\"hi\"]\n", + "helping_dict = {}\n", + "stored_mode = float('-inf')\n", + "stored_mode_key = \"placeholder\"\n", + "\n", + "for i in list_mode1:\n", + " if i not in helping_dict.keys():\n", + " helping_dict[i]=0\n", + "\n", + "\n", + "for i in list_mode1:\n", + " if i in helping_dict.keys():\n", + " helping_dict[i] = helping_dict[i] +1 \n", + " \n", + "#pretty sure this could be factored (factorized?)\n", + "\n", + "print(helping_dict)\n", + "\n", + "for key in helping_dict:\n", + " if helping_dict[key] > stored_mode:\n", + " stored_mode = helping_dict[key] \n", + " stored_mode_key = key\n", + " \n", + "print(stored_mode_key,stored_mode)" + ] + }, + { + "cell_type": "code", + "execution_count": 299, "metadata": {}, "outputs": [], "source": [ "def mode_counter(arr):\n", - " pass" + " #let's create a helping dictionary that in the future will store the unique elements of the arr as keys and their frequency as values\n", + " helping_dict = {}\n", + " #and a couple placeholders to later fill in with the key and value of the mode\n", + " stored_mode = float('-inf')\n", + " stored_mode_key = \"placeholder\"\n", + "\n", + " #turning the array into a unique keys-comprised dictionary:\n", + " for i in list_mode1:\n", + " if i not in helping_dict.keys():\n", + " helping_dict[i]=0\n", + "\n", + " #and for anytime the element in the array shows up, add one to the value of this newly reated dict:\n", + " for i in list_mode1:\n", + " if i in helping_dict.keys():\n", + " helping_dict[i] = helping_dict[i] +1 \n", + " \n", + "#pretty sure this could be factored (factorized?). Oh well, I've got one week of this, what do I know, MDR\n", + "\n", + " #looping thru the dictionary to iteratively replace the previous \"largest\" value in the dict with a new one (if the new one is larger ofc)\n", + " for key in helping_dict:\n", + " if helping_dict[key] > stored_mode:\n", + " stored_mode = helping_dict[key] \n", + " stored_mode_key = key\n", + " \n", + " return(f\"Should be '{stored_mode_key}' with a frequency of {stored_mode}\")" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 300, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "\"Should be 'hi' with a frequency of 11\"" + ] + }, + "execution_count": 300, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mode_counter([1,1,3,4,5,3,4,6,3,3,2,2,3,5,2,2,3,4,\"hi\",\"hi\",\"hi\",\"hi\",\"hi\",\"hi\",\"hi\",\"hi\",\"hi\",\"hi\",\"hi\"])" + ] + }, + { + "cell_type": "code", + "execution_count": 301, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 6 : Should be 6\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 25 : Should be 25\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 9 : Should be 9\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 10 : Should be 10\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 22 : Should be 22\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 21 : Should be 21\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 3 : Should be 3\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 3 : Should be 3\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 15 : Should be 15\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 20 : Should be 20\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 11 : Should be 11\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 5 : Should be 5\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 12 : Should be 12\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 12 : Should be 12\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 6 : Should be 6\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 19 : Should be 19\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 9 : Should be 9\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 19 : Should be 19\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 18 : Should be 18\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 19 : Should be 19\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 12 : Should be 12\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 6 : Should be 6\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 17 : Should be 17\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 24 : Should be 24\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 16 : Should be 16\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 5 : Should be 5\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 12 : Should be 12\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 6 : Should be 6\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 10 : Should be 10\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 9 : Should be 9\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 10 : Should be 10\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 24 : Should be 24\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 24 : Should be 24\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 10 : Should be 10\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 10 : Should be 10\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 15 : Should be 15\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 7 : Should be 7\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 9 : Should be 9\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 25 : Should be 25\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 22 : Should be 22\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 20 : Should be 20\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 23 : Should be 23\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 1 : Should be 1\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 11 : Should be 11\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 9 : Should be 9\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 18 : Should be 18\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 13 : Should be 13\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 18 : Should be 18\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 10 : Should be 10\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 24 : Should be 24\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 23 : Should be 23\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 3 : Should be 3\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 20 : Should be 20\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 6 : Should be 6\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 14 : Should be 14\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 10 : Should be 10\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 9 : Should be 9\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 5 : Should be 5\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 20 : Should be 20\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 21 : Should be 21\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 8 : Should be 8\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 8 : Should be 8\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 6 : Should be 6\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 9 : Should be 9\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 12 : Should be 12\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 11 : Should be 11\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 6 : Should be 6\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 9 : Should be 9\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 12 : Should be 12\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 22 : Should be 22\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 23 : Should be 23\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 25 : Should be 25\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 17 : Should be 17\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 9 : Should be 9\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 11 : Should be 11\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 7 : Should be 7\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 23 : Should be 23\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 12 : Should be 12\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 9 : Should be 9\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 19 : Should be 19\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 24 : Should be 24\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 5 : Should be 5\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 20 : Should be 20\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 10 : Should be 10\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 1 : Should be 1\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 11 : Should be 11\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 7 : Should be 7\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 5 : Should be 5\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 20 : Should be 20\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 20 : Should be 20\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 3 : Should be 3\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 3 : Should be 3\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 5 : Should be 5\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 18 : Should be 18\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 12 : Should be 12\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 9 : Should be 9\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 19 : Should be 19\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 1 : Should be 1\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 21 : Should be 21\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mocid\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: \"Should be 'hi' with a frequency of 11\" != 15 : Should be 15\n", + "\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.194s\n", + "\n", + "FAILED (failures=100)\n" + ] + } + ], "source": [ "# This will test your function \n", "test_mode(mode_counter)" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, { "cell_type": "markdown", "metadata": {}, @@ -388,7 +2150,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.13" + "version": "3.11.4" }, "toc": { "base_numbering": 1,