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
52 changes: 52 additions & 0 deletions Challenge_10-07/q1.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Abaixo do peso 3.1\n"
]
}
],
"source": [
"peso = float(input(\"Qual o seu peso?\"))\n",
"altura = float(input(\"Qual sua altura? \"))\n",
"imc = peso / (altura **2)\n",
"if imc < 18.5:\n",
" print(f\"Abaixo do peso {imc:.2}\")\n",
"elif imc >= 18.5 and imc < 25:\n",
" print(f\"Peso ideal {imc:.2}\")\n",
"elif imc >= 25 and imc < 30:\n",
" print(f\"Sobrepeso {imc:.2}\")\n",
"else:\n",
" print(f\"Obesidade {imc:.2}\")"
]
}
],
"metadata": {
"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.10.4"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
70 changes: 70 additions & 0 deletions Challenge_10-07/q2.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 42,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"O maior número é: 2226.0 e os outros são [1215.0, 2226.0, 21.0]\n"
]
}
],
"source": [
"I = int(input(\"Digite um número inteiro: \"))\n",
"A = float(input(\"Digite um número float: \"))\n",
"B = float(input(\"Digite um número float: \"))\n",
"C = float(input(\"Digite um número float: \"))\n",
"\n",
"num_list = [A, B, C]\n",
"\n",
"if I == 1:\n",
" maior = max(num_list)\n",
" result = sorted(num_list)\n",
" print(\"O maior número é:\", maior, \"e os outros são\", result)\n",
"elif I == 2:\n",
" menor = min(num_list)\n",
" result = sorted(num_list, reverse=True)\n",
" print(\"O menor número é:\", menor, \"e os outros são\", result)\n",
"elif I == 3:\n",
" maior = max(num_list)\n",
" num_list.remove(maior)\n",
" num_list.insert(1, maior)\n",
" print(\"O maior número é:\", maior, \"e os outros são\", num_list)\n",
"else:\n",
" print(\"Opção inválida\")\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"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.10.4"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
4 changes: 2 additions & 2 deletions Untitled.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{
"cell_type": "code",
"execution_count": 9,
"id": "804a83fa",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -72,8 +73,7 @@
"print(\"#\"*12)\n",
"nome = input(\"Digite seu nome?\")\n",
"endereço = input(\"Digite seu endereço?\")\n",
"print(f\"Seu nome é {nome} e você reside em {endereço}\")\n",
"print(\"dale\")"
"print(f\"Seu nome é {nome} e você reside em {endereço}\")"
]
},
{
Expand Down