Skip to content

Commit 87d3bb4

Browse files
Criado através do Colaboratory
1 parent 7fa46c6 commit 87d3bb4

1 file changed

Lines changed: 92 additions & 0 deletions

File tree

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {
6+
"id": "view-in-github",
7+
"colab_type": "text"
8+
},
9+
"source": [
10+
"<a href=\"https://colab.research.google.com/github/marcilioduarte/br-python-challenges/blob/master/Desafio_9_de_Python_Awari_Data_Sciece_Aluno_Marcilio_Duarte_Turma_DS38.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
11+
]
12+
},
13+
{
14+
"cell_type": "markdown",
15+
"metadata": {
16+
"id": "49Sr3EsN6B9a"
17+
},
18+
"source": [
19+
"![](https://i.imgur.com/YX6UATs.png)"
20+
]
21+
},
22+
{
23+
"cell_type": "markdown",
24+
"metadata": {
25+
"id": "c1J5PNGv6GK_"
26+
},
27+
"source": [
28+
"### Desafio 9\n",
29+
"\n",
30+
"Escreva uma função que retorne a soma dos múltiplos de 3 e 5 entre 0 e um número limite, que vai ser utilizado como parâmetro. \\\n",
31+
"Por exemplo, se o limite for 20, ele retornará a soma de 3, 5, 6, 9, 10, 12, 15, 18, 20."
32+
]
33+
},
34+
{
35+
"cell_type": "code",
36+
"execution_count": null,
37+
"metadata": {
38+
"id": "KoZW8Ebu-sOp"
39+
},
40+
"outputs": [],
41+
"source": [
42+
"def soma_mt_3e5(x):\n",
43+
" y=[a for a in range(1, x+1) if a%3==0 or a%5==0]\n",
44+
" soma=sum(y)\n",
45+
" return soma"
46+
]
47+
},
48+
{
49+
"cell_type": "code",
50+
"execution_count": null,
51+
"metadata": {
52+
"colab": {
53+
"base_uri": "https://localhost:8080/"
54+
},
55+
"id": "qPKCOqEyAhUX",
56+
"outputId": "5585534e-a95f-4e30-cac6-e23d99295347"
57+
},
58+
"outputs": [
59+
{
60+
"output_type": "execute_result",
61+
"data": {
62+
"text/plain": [
63+
"98"
64+
]
65+
},
66+
"metadata": {},
67+
"execution_count": 21
68+
}
69+
],
70+
"source": [
71+
"soma_mt_3e5(20)"
72+
]
73+
}
74+
],
75+
"metadata": {
76+
"colab": {
77+
"name": "Desafio 9 de Python - Awari_Data Sciece - Aluno: Marcilio Duarte_Turma_DS38",
78+
"provenance": [],
79+
"authorship_tag": "ABX9TyO7xNNT7IWz9/+AxLeM8aGw",
80+
"include_colab_link": true
81+
},
82+
"kernelspec": {
83+
"display_name": "Python 3",
84+
"name": "python3"
85+
},
86+
"language_info": {
87+
"name": "python"
88+
}
89+
},
90+
"nbformat": 4,
91+
"nbformat_minor": 0
92+
}

0 commit comments

Comments
 (0)