This file contains hidden or 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
validacao = False | |
while (validacao is False): | |
sexo = str(input('Informe o seu sexo, sendo M - Masculino e F- Feminimo: ')) | |
if sexo == 'M' or sexo == 'm' or sexo == 'F' or sexo == 'f': | |
validacao = True | |
else: | |
validacao = False | |
This file contains hidden or 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
import random | |
tentativas = 0 | |
palpite = False | |
numSorteado = random.randint(1,10) | |
while (palpite is False): | |
num = int(input('Digite um numero: ')) | |
if num != numSorteado: | |
tentativas = tentativas + 1 | |
else: |
This file contains hidden or 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
count = 0 | |
for c in range(1,7): | |
letter = str(input('Digite a primeira {} vogal: '.format(c))) | |
if letter == 'A' or letter == 'a': | |
count = count + 1 | |
print('Você informou a vogal A {} vezes'.format(count)) |
This file contains hidden or 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
sum = 0 | |
count = 0 | |
for c in range(1,7): | |
num = int(input('Digite o {} valor: '.format(c))) | |
if num % 2 == 0: | |
sum = sum + num | |
count = count + 1 | |
print('Você informou {} números PARES e a soma foi {}'.format(count, sum)) |
This file contains hidden or 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
for i in range(1,3): | |
print(i) |
This file contains hidden or 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
names = ['Maria', 'João', 'Jose', 'Cleiton', 'Pedro'] | |
for name in names: | |
print(name) |
This file contains hidden or 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
function firstAttack() { | |
if [monsterA.speed == monsterB.speed] then | |
if[monsterA.attack > monsterB.attack] then | |
monsterAttack = monsterA | |
monsterDefense = monsterB | |
else | |
monsterAttack = monsterB | |
monsterDefense = monsterA | |
fi | |
else if [monsterA.speed > monsterB.speed] then |
This file contains hidden or 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
npm init -y | |
npm i typescript [email protected] @types/node @types/[email protected] [email protected] --save-dev | |
This file contains hidden or 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
swagger: "2.0" | |
info: | |
description: "Prover acesso ao recurso de usuários." | |
version: "0.0.1" | |
title: "Lista de Usuários" | |
termsOfService: "http://swagger.io/terms/" | |
contact: | |
name: Paulo | |
email: "[email protected]" | |
license: |
This file contains hidden or 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
1. First make the download the Go installer: curl -k https://go.dev/dl/go1.19.4.linux-amd64.tar.gz -o go.1.19.14.linux-amd64.tar.gz | |
2. You need remove any previous Go installation (if it exists), and then extract the file downloaded before: rm -rf /usr/local/go && tar -C /usr/local -xzf go1.19.4.linux-amd64.tar.gz | |
3. Add the go PATH in PATH environment variable: export PATH=$PATH:/usr/local/go/bin | |
4. Open the profile file: vim ~/.profile | |
5. In the end profile file add the go PATH: PATH=$PATH:/usr/local/go/bin | |
6. Install de protocol buffter compiler: apt install protobuf-compiler | |
7. Install the go plugins for working with gRPC: | |
go install google.golang.org/protobuf/cmd/[email protected] | |
go install google.golang.org/grpc/cmd/[email protected] | |
8. Update your PATH with protoc complier can find the plugins: |