Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions Desafio_01.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,30 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": 4,
"metadata": {
"colab": {},
"colab_type": "code",
"id": "WhtbdwFseldD"
},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"Counter({'red': 4,\n",
" 'green': 4,\n",
" 'black': 5,\n",
" 'pink': 6,\n",
" 'white': 5,\n",
" 'eyes': 1,\n",
" 'orange': 4})"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"palavras = [\n",
" 'red', 'green', 'black', 'pink', 'black', 'white', 'black', 'eyes',\n",
Expand All @@ -40,7 +57,9 @@
"]\n",
"\n",
"\n",
"# Seu código"
"# Seu código\n",
"from collections import Counter\n",
"Counter(palavras)"
]
},
{
Expand Down Expand Up @@ -77,7 +96,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.9"
"version": "3.8.5"
}
},
"nbformat": 4,
Expand Down
43 changes: 40 additions & 3 deletions Desafio_02.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": 20,
"metadata": {
"colab": {},
"colab_type": "code",
Expand All @@ -38,8 +38,45 @@
"outputs": [],
"source": [
"def convert_to_sec(number):\n",
" pass # Seu código"
" if type(number) is not int:\n",
" return 'Erro'\n",
" else:\n",
" return number*3600 # Seu código"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"18000"
]
},
"execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"convert_to_sec(5)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -64,7 +101,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.9"
"version": "3.8.5"
}
},
"nbformat": 4,
Expand Down
28 changes: 24 additions & 4 deletions Desafio_03.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,37 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": 1,
"metadata": {
"colab": {},
"colab_type": "code",
"id": "ndTkQEUBf6JS"
},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"[1, 2, 3, 4, 5, 6, 9, 13, 15, 30, 45]"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"lista = [1,2,3,4,3,30,3,4,5,6,9,3,2,1,2,4,5,15,6,6,3,13,4,45,5]\n",
"\n",
"# Seu código"
"# Seu código\n",
"\n",
"def remove_repetidos(lista):\n",
" l = []\n",
" for i in lista:\n",
" if i not in l:\n",
" l.append(i)\n",
" l.sort()\n",
" return l\n",
"remove_repetidos(lista)"
]
},
{
Expand Down Expand Up @@ -71,7 +91,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.9"
"version": "3.8.5"
}
},
"nbformat": 4,
Expand Down
61 changes: 58 additions & 3 deletions Desafio_04.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,71 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": 2,
"metadata": {
"colab": {},
"colab_type": "code",
"id": "I5TInJDaf6JW"
},
"outputs": [
{
"data": {
"text/plain": [
"'legal é Python'"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Seu código\n",
"def ordem_inversa (sentence):\n",
" words = sentence.split(' ')\n",
" reverse_sentence = ' '.join(reversed(words)) \n",
" return reverse_sentence \n",
"ordem_inversa('Python é legal')\n",
" "
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"# Seu código"
"def inverte_texto (texto):\n",
" lista_invertida = texto.split(' ')[::-1]\n",
" return ' '.join(lista_invertida)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'legal é Python'"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"inverte_texto('Python é legal')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -62,7 +117,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.9"
"version": "3.8.5"
}
},
"nbformat": 4,
Expand Down
43 changes: 38 additions & 5 deletions Desafio_05.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": 2,
"metadata": {
"colab": {},
"colab_type": "code",
Expand Down Expand Up @@ -59,16 +59,49 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": 3,
"metadata": {
"colab": {},
"colab_type": "code",
"id": "F8n1sN-4XrW3"
},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"['(885) 407-1719',\n",
" '(285) 608-2448',\n",
" '(554) 994-1517',\n",
" '(650) 684-1437',\n",
" '(311) 799-3883',\n",
" '(464) 788-2397',\n",
" '(255) 826-9050',\n",
" '(943) 769-1061',\n",
" '(596) 336-5508',\n",
" '(410) 665-4447',\n",
" '(765) 368-1506',\n",
" '(935) 875-2054',\n",
" '(812) 816-0881',\n",
" '(821) 642-8987',\n",
" '(511) 821-7870']"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#Seu código"
"#Seu código\n",
"list(set(numeros_telefone))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -93,7 +126,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.9"
"version": "3.8.5"
}
},
"nbformat": 4,
Expand Down
38 changes: 34 additions & 4 deletions Desafio_06.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -41,7 +41,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": 4,
"metadata": {
"colab": {},
"colab_type": "code",
Expand All @@ -54,13 +54,43 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": 5,
"metadata": {
"colab": {},
"colab_type": "code",
"id": "ly-N_Aq624RQ"
},
"outputs": [],
"source": [
"def junta_listas (lista_1,lista_2):\n",
" return list(set.intersection(set(lista_1),set(lista_2)))"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[1, 2, 3, 5, 8, 13]"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"junta_listas(a,b)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
Expand All @@ -86,7 +116,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.9"
"version": "3.8.5"
}
},
"nbformat": 4,
Expand Down
Loading