Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2db1152
Criado usando o Colaboratory
antunes-lima Apr 22, 2022
bc3ebe2
Criado usando o Colaboratory
antunes-lima Apr 22, 2022
446b640
Criado usando o Colaboratory
antunes-lima Apr 22, 2022
a7f03c5
Criado usando o Colaboratory
antunes-lima Apr 22, 2022
1363fc9
Criado usando o Colaboratory
antunes-lima Apr 22, 2022
e5cad38
Criado usando o Colaboratory
antunes-lima Apr 22, 2022
5333260
Criado usando o Colaboratory
antunes-lima Apr 22, 2022
484da58
Criado usando o Colaboratory
antunes-lima Apr 22, 2022
b4d0bf0
Criado usando o Colaboratory
antunes-lima Apr 22, 2022
bc168a0
Criado usando o Colaboratory
antunes-lima Apr 23, 2022
13a304a
Criado usando o Colaboratory
antunes-lima Apr 23, 2022
0a5acd8
Delete Desafio_08 PAREI AQUI.ipynb
antunes-lima Apr 23, 2022
5b52c83
Criado usando o Colaboratory
antunes-lima Apr 23, 2022
10cebff
Criado usando o Colaboratory
antunes-lima Apr 23, 2022
eb64836
Criado usando o Colaboratory
antunes-lima Apr 23, 2022
9353cce
Criado usando o Colaboratory
antunes-lima Apr 23, 2022
d689ae4
Criado usando o Colaboratory
antunes-lima Apr 23, 2022
1988010
Delete resolucao_exemplo directory
antunes-lima Apr 23, 2022
f44b752
Update README.md
antunes-lima Apr 23, 2022
59f0580
Delete Desafio_01.ipynb
antunes-lima Apr 23, 2022
9c2c30a
Delete Desafio_02.ipynb
antunes-lima Apr 23, 2022
76caa16
Delete Desafio_03.ipynb
antunes-lima Apr 23, 2022
dd09772
Delete Desafio_04.ipynb
antunes-lima Apr 23, 2022
26d36d4
Delete Desafio_05.ipynb
antunes-lima Apr 23, 2022
e38ea63
Delete Desafio_06.ipynb
antunes-lima Apr 23, 2022
754291a
Delete Desafio_07.ipynb
antunes-lima Apr 23, 2022
5f3cbaf
Delete Desafio_08.ipynb
antunes-lima Apr 23, 2022
a240dbe
Delete Desafio_09.ipynb
antunes-lima Apr 23, 2022
5d9100e
Delete Desafio_10.ipynb
antunes-lima Apr 23, 2022
96def57
Delete Desafio_11.ipynb
antunes-lima Apr 23, 2022
d880cf4
Delete Desafio_12.ipynb
antunes-lima Apr 23, 2022
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
81 changes: 81 additions & 0 deletions Challenge_01.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "SbLLE9q1eldC"
},
"source": [
"### Challenge 1\n",
"\n",
"Write a Python program to count the number of occurrences of each word."
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "WhtbdwFseldD",
"outputId": "369956c7-b9d6-49f3-c362-61d9a350f53b"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"{'pink': 6, 'red': 4, 'eyes': 1, 'orange': 4, 'white': 5, 'black': 5, 'green': 4}\n"
]
}
],
"source": [
"words = [\n",
" 'red', 'green', 'black', 'pink', 'black', 'white', 'black', 'eyes',\n",
" 'white', 'black', 'orange', 'pink', 'pink', 'red', 'red', 'white', 'orange',\n",
" 'white', \"black\", 'pink', 'green', 'green', 'pink', 'green', 'pink',\n",
" 'white', 'orange', \"orange\", 'red'\n",
"]\n",
"\n",
"\n",
"# Code\n",
"\n",
"words_set = set(words)\n",
"\n",
"words_dict = dict()\n",
"\n",
"for word in words_set:\n",
" words_dict[word] = words.count(word)\n",
"\n",
"print(words_dict)"
]
}
],
"metadata": {
"anaconda-cloud": {},
"colab": {
"name": "Desafio 1.ipynb",
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.9"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
96 changes: 96 additions & 0 deletions Challenge_02.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "q1NCks7Af6JN"
},
"source": [
"### Challenge 2\n",
"\n",
"Write a function that takes an integer number of hours and converts that number to seconds.\n",
"\n",
"Example:\n",
"\n",
"convert(5) ➞ 18000\n",
"\n",
"convert(3) ➞ 10800\n",
"\n",
"convert(2) ➞ 7200"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"id": "sSm6F7sff6JO"
},
"outputs": [],
"source": [
"def convert_to_sec(number):\n",
" seconds = number * 60 * 60\n",
" return seconds"
]
},
{
"cell_type": "code",
"source": [
"print(convert_to_sec(5))\n",
"print(convert_to_sec(3))\n",
"print(convert_to_sec(2))\n",
"\n",
"print(convert_to_sec(10))\n",
"print(convert_to_sec(8))\n",
"print(convert_to_sec(1))"
],
"metadata": {
"id": "-lpAkLKQoFK3",
"outputId": "94f7e9e8-86f6-4983-959a-dbed9ebc9cc6",
"colab": {
"base_uri": "https://localhost:8080/"
}
},
"execution_count": 6,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"18000\n",
"10800\n",
"7200\n",
"36000\n",
"28800\n",
"3600\n"
]
}
]
}
],
"metadata": {
"anaconda-cloud": {},
"colab": {
"name": "Desafio 2.ipynb",
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.9"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
83 changes: 83 additions & 0 deletions Challenge_03.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "9apVxxygf6JR"
},
"source": [
"### Challenge 3\n",
"\n",
"Write a function that takes a list as input and returns a new ordered list with no duplicate values.\n"
]
},
{
"cell_type": "code",
"source": [
"# Code\n",
"\n",
"def list_order(input_list):\n",
" output_list = set(input_list)\n",
" output_list = list(output_list)\n",
" output_list.sort()\n",
" return output_list\n"
],
"metadata": {
"id": "f8nPzidCWfbu"
},
"execution_count": 4,
"outputs": []
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "ndTkQEUBf6JS",
"outputId": "8ae5e31a-e350-4359-e24f-9cca512a61b4"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"[1, 2, 3, 4, 5, 6, 9, 13, 15, 30, 45]\n"
]
}
],
"source": [
"values_list = [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",
"print(list_order(values_list))"
]
}
],
"metadata": {
"anaconda-cloud": {},
"colab": {
"name": "Desafio 3.ipynb",
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.9"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
76 changes: 76 additions & 0 deletions Challenge_04.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "dOqcKUYZf6JW"
},
"source": [
"### Challenge 4\n",
"\n",
"Write a function whose input is a string and the output is another string with the words in reverse order.\n",
"\n",
"Example:\n",
"\n",
"text_inverter(\"Python is nice\") ➞ \"nice is Python\""
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "I5TInJDaf6JW",
"outputId": "bbf659ca-a6a8-4448-d208-8e5ff4d7ef96"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"order reverse in words the with string another is output the and string a is input whose function a Write\n"
]
}
],
"source": [
"# Code\n",
"\n",
"def text_inverter(text):\n",
" inv = text.split()\n",
" inv.reverse()\n",
" return ( ' '.join(inv) )\n",
"\n",
"test = 'Write a function whose input is a string and the output is another string with the words in reverse order'\n",
"print( text_inverter(test) )"
]
}
],
"metadata": {
"anaconda-cloud": {},
"colab": {
"name": "Desafio 4.ipynb",
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.9"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Loading