Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
tap1012
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mario Chirinos Colunga
tap1012
Commits
ef53495a
Commit
ef53495a
authored
Jan 21, 2019
by
Alejandro Molina Villegas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
para la clase
parent
52887fb8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
93 additions
and
1 deletion
+93
-1
01-DataTypes&ControlFlow.ipynb
01-DataTypes&ControlFlow.ipynb
+93
-1
No files found.
01-DataTypes&ControlFlow.ipynb
View file @
ef53495a
...
...
@@ -855,13 +855,39 @@
},
{
"cell_type": "code",
"execution_count":
32
,
"execution_count":
null
,
"metadata": {},
"outputs": [],
"source": [
"a = [1,2,2,3,3,3,3,4,5,5]"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"OK\n"
]
}
],
"source": [
"def test_list2set():\n",
" a = [1,2,2,3,3,3,3,4,5,5]\n",
" b = [1,2,3,4,5]\n",
" print(\"OK\" if list2set(a)==b else \"KO\")\n",
"\n",
"def list2set(some_list):\n",
" my_set = list(set(some_list))\n",
" return my_set\n",
"\n",
"test_list2set()"
]
},
{
"cell_type": "markdown",
"metadata": {},
...
...
@@ -922,6 +948,72 @@
"[Wikipedia](https://es.wikipedia.org/wiki/Pangrama):Un pangrama (del griego: παν γραμμα, «todas las letras») o frase holoalfabética es un texto que usa todas las letras posibles del alfabeto de un idioma. "
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"a True\n",
"b True\n",
"c True\n",
"d True\n",
"e True\n",
"f True\n",
"g True\n",
"h True\n",
"i True\n",
"j True\n",
"k True\n",
"l True\n",
"m True\n",
"n True\n",
"ñ True\n",
"o True\n",
"p True\n",
"q True\n",
"r True\n",
"s True\n",
"t True\n",
"u True\n",
"v True\n",
"w True\n",
"x True\n",
"y True\n",
"z True\n",
"27 True\n",
"a True\n",
"b False\n",
"2 False\n",
"OK\n"
]
}
],
"source": [
"def test_pangram():\n",
" pangram = \"jovencillo emponzoñado de whisky , qué figurota exhibe !\"\n",
" nopangram = \"Agua pasa por mi casa\"\n",
"\n",
" print(\"OK\" if is_pangram(pangram) and not is_pangram(nopangram) else \"KO\")\n",
"\n",
"def is_pangram(string):\n",
" alfabet = ['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",
" i = 0\n",
" for char in alfabet:\n",
" char_included = char in string\n",
" print(char, char_included)\n",
" i += 1\n",
" if not char_included:\n",
" break\n",
" print(i, i==len(alfabet))\n",
" return(i==len(alfabet))\n",
"\n",
"test_pangram()"
]
},
{
"cell_type": "markdown",
"metadata": {},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment