-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AULA 3[Desafio feito em sala de aula]
- Loading branch information
1 parent
52e6ec1
commit 656dadc
Showing
1 changed file
with
135 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 18, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"O seu nome é: Daniel e sua idade é 20\n", | ||
"False\n", | ||
"False\n", | ||
"True\n", | ||
"False\n", | ||
"True\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"nome = input(\"Digite seu nome: \")\n", | ||
"idade = int(input(\"Digite sua idade: \"))\n", | ||
"\n", | ||
"print(f\"O seu nome é: {nome} e sua idade é {idade}\")\n", | ||
"\n", | ||
"valor1 = input(\"Digite um número inteiro: \")\n", | ||
"valor2 = input(\"Digite outro valor número inteiro: \")\n", | ||
"\n", | ||
"print(valor1 == valor2)\n", | ||
"print(valor1 > valor2)\n", | ||
"print(valor1 < valor2)\n", | ||
"print(valor1 >= valor2)\n", | ||
"print(valor1 <= valor2)\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 22, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"BEM VINDO!!! \n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"senhaCadastro = input(\"Digite uma senha para cadastro: \")\n", | ||
"\n", | ||
"senha = input(\"Para acessar o sistema digite sua senha: \")\n", | ||
"\n", | ||
"if (senhaCadastro == senha):\n", | ||
" print(\"BEM VINDO!!! \")\n", | ||
"else:\n", | ||
" print(\"Senha incorreta.\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 29, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"O número 5 é impar\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"#DESAFIO. Algoritmo que avalia se um número é par ou impar.\n", | ||
"numero = int(input(\"Digite um número: \"))\n", | ||
"\n", | ||
"if numero == 0:\n", | ||
" print(\"Digite um número diferente de 0\")\n", | ||
"elif numero % 2 == 0:\n", | ||
" print(f\"O número {numero} é par\")\n", | ||
"else:\n", | ||
" print(f\"O número {numero} é impar\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 27, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Você ganhou 10% de desconto\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"cupom = input(\"Digite o cupom: \")\n", | ||
"\n", | ||
"if cupom == \"aula1\" or cupom == \"aula2\":\n", | ||
" print(\"Você ganhou 10% de desconto\")" | ||
] | ||
}, | ||
{ | ||
"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.11.8" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |