Skip to content

Commit 5e6d103

Browse files
OK. I will translate all .md files and Python comments to Brazilian Portuguese.
1 parent 5a2f8e9 commit 5e6d103

27 files changed

+2575
-3313
lines changed

README.md

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,115 +1,115 @@
1-
# 10 Days of Code with AI
1+
# 10 Dias de Código com IA
22

3-
This repository contains the course notes and code examples of the course [10 Days of Python with AI]. The course is aimed for curious Vibe coders with no programming background who want to have a wholistic view of coding and ai technologies and the skills to debug, specify and scrutinise code that is mainly produced with AI.
3+
Este repositório contém as notas do curso e exemplos de código do curso [10 Dias de Python com IA]. O curso é voltado para programadores curiosos do Vibe, sem experiência em programação, que desejam ter uma visão holística da codificação e das tecnologias de IA e as habilidades para depurar, especificar e examinar o código que é produzido principalmente com IA.
44

5-
The course is mainly produce to use [Visual Studio Code] and [Github Copilot]; and a big part of it uses python for automatization, API calls, web programming, AI programming and more.
5+
O curso é produzido principalmente para usar o [Visual Studio Code] e o [Github Copilot]; e grande parte dele usa python para automação, chamadas de API, programação web, programação de IA e muito mais.
66

7-
The course notes themselves may be found in [10 Days of Code with AI course notes] and the code examples in [git hub code examples]. Once [Visual Studio Code] and [python] are installed in your machine, you can run the examples by simply typing in your terminal:
7+
As notas do curso podem ser encontradas em [notas do curso 10 Dias de Código com IA] e os exemplos de código em [exemplos de código do git hub]. Uma vez que o [Visual Studio Code] e o [python] estejam instalados em sua máquina, você pode executar os exemplos simplesmente digitando em seu terminal:
88

99
```python
10-
python <filename>.py
10+
python <nome_do_arquivo>.py
1111
```
1212

13-
## Cloning the Repository
13+
## Clonando o Repositório
1414

15-
If you wish you could install git on your vs code and clone this repository in your local machine.
15+
Se desejar, você pode instalar o git no seu vs code e clonar este repositório em sua máquina local.
1616

17-
### Installing Bash in Visual Studio Code
17+
### Instalando o Bash no Visual Studio Code
1818

19-
If you're on Windows and want to use Bash in VS Code, you can install [Git for Windows](https://git-scm.com/download/win), which includes Git Bash.
19+
Se você estiver no Windows e quiser usar o Bash no VS Code, pode instalar o [Git para Windows](https://git-scm.com/download/win), que inclui o Git Bash.
2020

21-
1. Download and install Git for Windows.
22-
2. After installation, open VS Code.
23-
3. Press <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> and type `Terminal: Select Default Profile`.
24-
4. Choose `Git Bash` from the list.
21+
1. Baixe e instale o Git para Windows.
22+
2. Após a instalação, abra o VS Code.
23+
3. Pressione <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> e digite `Terminal: Select Default Profile`.
24+
4. Escolha `Git Bash` na lista.
2525

26-
Now, when you open a new terminal in VS Code, it will use Bash.
26+
Agora, quando você abrir um novo terminal no VS Code, ele usará o Bash.
2727

28-
> **Note:** Installing Git for Windows will also install Git Bash. You do not need to install Git separately—Git Bash is included as part of the Git installation package.
28+
> **Nota:** A instalação do Git para Windows também instalará o Git Bash. Você não precisa instalar o Git separadamente—o Git Bash está incluído como parte do pacote de instalação do Git.
2929
30-
### Create a virtual environmenta and activate
31-
A **virtual environment** in Python is an isolated workspace that allows you to install and manage packages separately from your global Python installation. This means each project can have its own dependencies, versions, and settings without interfering with other projects or the system Python.
30+
### Crie um ambiente virtual e ative-o
31+
Um **ambiente virtual** em Python é um espaço de trabalho isolado que permite instalar e gerenciar pacotes separadamente da sua instalação global do Python. Isso significa que cada projeto pode ter suas próprias dependências, versões e configurações sem interferir em outros projetos ou no Python do sistema.
3232

33-
**Why use a virtual environment?**
33+
**Por que usar um ambiente virtual?**
3434

35-
- Isolation: Keeps project dependencies separate, avoiding conflicts between packages required by different projects.
36-
- Reproducibility: Makes it easier to share your project with others, since you can specify exactly which packages and versions are needed.
37-
Safety: Prevents accidental changes to system-wide Python packages.
35+
- Isolamento: Mantém as dependências do projeto separadas, evitando conflitos entre pacotes exigidos por diferentes projetos.
36+
- Reprodutibilidade: Facilita o compartilhamento do seu projeto com outras pessoas, pois você pode especificar exatamente quais pacotes e versões são necessários.
37+
- Segurança: Evita alterações acidentais nos pacotes Python de todo o sistema.
3838

39-
Typical workflow:
40-
- Create a virtual environment for your project.
41-
- Activate it before working.
42-
- Install packages using pip—these go only into the virtual environment.
43-
- Deactivate when done.
39+
Fluxo de trabalho típico:
40+
- Crie um ambiente virtual para o seu projeto.
41+
- Ative-o antes de trabalhar.
42+
- Instale pacotes usando o pip—estes vão apenas para o ambiente virtual.
43+
- Desative quando terminar.
4444

45-
This approach is especially useful in collaborative or production settings, ensuring consistency and minimizing dependency issues.
45+
Essa abordagem é especialmente útil em ambientes colaborativos ou de produção, garantindo consistência e minimizando problemas de dependência.
4646

47-
To create a Python virtual environment, run the following command in your terminal:
47+
Para criar um ambiente virtual Python, execute o seguinte comando em seu terminal:
4848

4949
```bash
5050
python -m venv venv
5151
```
5252

53-
This will create a new directory called `venv` containing the virtual environment.
53+
Isso criará um novo diretório chamado `venv` contendo o ambiente virtual.
5454

55-
To activate the virtual environment:
55+
Para ativar o ambiente virtual:
5656

57-
- On Windows:
57+
- No Windows:
5858
```bash
5959
.\venv\Scripts\activate
6060
```
61-
- On macOS/Linux/bash terminal:
61+
- No macOS/Linux/terminal bash:
6262
```bash
6363
source venv/bin/activate
6464
```
6565

66-
Once activated, you can install packages using `pip` and they will be isolated to this environment.
66+
Uma vez ativado, você pode instalar pacotes usando o `pip` e eles ficarão isolados neste ambiente.
6767

68-
To deactivate the Python virtual environment, simply run:
68+
Para desativar o ambiente virtual Python, simplesmente execute:
6969

7070
```bash
7171
deactivate
7272
```
7373

74-
This will return your terminal to the global Python environment.
74+
Isso retornará seu terminal ao ambiente Python global.
7575

7676

77-
### Clone this repository
77+
### Clone este repositório
7878

79-
To clone this repository to your local machine, open your terminal and run:
79+
Para clonar este repositório para sua máquina local, abra seu terminal e execute:
8080

8181
```bash
8282
git clone https://github.com/StructuralWizard/10DaysOfCode.github.io.git
8383
```
8484

85-
This will create a local copy of the repository in your current directory.
85+
Isso criará uma cópia local do repositório em seu diretório atual.
8686

87-
### Install the dependencies of this repository
88-
To install the dependencies listed in `requirements.txt`, make sure your virtual environment is activated, then run:
87+
### Instale as dependências deste repositório
88+
Para instalar as dependências listadas em `requirements.txt`, certifique-se de que seu ambiente virtual esteja ativado e, em seguida, execute:
8989

9090
```bash
9191
pip install -r requirements.txt
9292
```
9393

94-
This will install all the required Python packages for the project.
94+
Isso instalará todos os pacotes Python necessários para o projeto.
9595

96-
### Run site in local server
97-
This site has been created using [Just the Docs] theme and the hosted in [GitHub Pages]. You can [Browse our documentation] for more information.
96+
### Execute o site no servidor local
97+
Este site foi criado usando o tema [Just the Docs] e hospedado no [GitHub Pages]. Você pode [Navegar em nossa documentação] para mais informações.
9898

99-
To visualise the github site in the browser rather than editing its markdown you can run `bundle exec jekyll serve` from the main 10DaysOfCode folder where you have the _config.yml file.
99+
Para visualizar o site do github no navegador em vez de editar seu markdown, você pode executar `bundle exec jekyll serve` na pasta principal 10DaysOfCode, onde você tem o arquivo _config.yml.
100100

101-
Assuming [Jekyll] and [Bundler] are installed on your computer:
101+
Assumindo que [Jekyll] e [Bundler] estão instalados em seu computador:
102102

103-
1. Change your working directory to the root directory of your site.
103+
1. Mude seu diretório de trabalho para o diretório raiz do seu site.
104104

105-
2. Run `bundle install`.
105+
2. Execute `bundle install`.
106106

107-
3. Run `bundle exec jekyll serve` to build your site and preview it at `localhost:4000`.
107+
3. Execute `bundle exec jekyll serve` para construir seu site e visualizá-lo em `localhost:4000`.
108108

109-
The built site is stored in the directory `_site`.
109+
O site construído é armazenado no diretório `_site`.
110110

111111

112-
Note: If you are using a Jekyll version less than 3.5.0, use the `gems` key instead of `plugins`.
112+
Nota: Se você estiver usando uma versão do Jekyll inferior a 3.5.0, use a chave `gems` em vez de `plugins`.
113113

114114

115115

@@ -122,7 +122,7 @@ Note: If you are using a Jekyll version less than 3.5.0, use the `gems` key inst
122122
[Just the Docs]: https://just-the-docs.github.io/just-the-docs/
123123
[GitHub Pages]: https://docs.github.com/en/pages
124124
[Bundler]: https://bundler.io
125-
[10 Days of Python with AI]: https://youtube.com/@10daysofpythonwithai?si=3wobcw1e11B7dlZI
126-
[Structural Wizard]: https://github.com/StructuralWizard/
127-
[10 Days of Code with AI course notes]: https://structuralwizard.github.io/10DaysOfCode.github.io/
128-
[git hub code examples]: https://github.com/StructuralWizard/10DaysOfCode.github.io/tree/main/_python_code
125+
[10 Dias de Python com IA]: https://youtube.com/@10daysofpythonwithai?si=3wobcw1e11B7dlZI
126+
[Structural Wizard]: https://github.com/StructuralWizard/
127+
[notas do curso 10 Dias de Código com IA]: https://structuralwizard.github.io/10DaysOfCode.github.io/
128+
[exemplos de código do git hub]: https://github.com/StructuralWizard/10DaysOfCode.github.io/tree/main/_python_code

_python_code/Day1/monster_maze.py

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,71 @@
11
import random
22

3-
# Constants
4-
ROOMS = ["Hall", "Kitchen", "Library", "Dungeon", "Garden"]
5-
ITEMS = ["sword", "potion", "shield"]
6-
MONSTERS = ["Goblin", "Troll", "Skeleton"]
3+
# Constantes
4+
ROOMS = ["Salão", "Cozinha", "Biblioteca", "Masmorra", "Jardim"]
5+
ITEMS = ["espada", "poção", "escudo"]
6+
MONSTERS = ["Goblin", "Troll", "Esqueleto"]
77

8-
# Global variable
8+
# Variável global
99
found_key = False
1010

1111
def print_welcome():
12-
"""Prints the welcome message with ASCII art."""
12+
"""Imprime a mensagem de boas-vindas com arte ASCII."""
1313
print("""
14-
🧟‍♂️ MONSTER MAZE 🧟‍♀️
15-
Escape the maze, defeat monsters, and find the key!
16-
""") # String manipulation and printing
14+
🧟‍♂️ LABIRINTO DE MONSTROS 🧟‍♀️
15+
Escape do labirinto, derrote monstros e encontre a chave!
16+
""") # Manipulação e impressão de strings
1717

1818
def create_player(name):
19-
"""Returns a new player dictionary."""
19+
"""Retorna um novo dicionário de jogador."""
2020
return {
2121
"name": name,
2222
"health": 100,
2323
"inventory": [],
24-
"location": random.choice(ROOMS) # Random module
24+
"location": random.choice(ROOMS) # Módulo random
2525
}
2626

2727
def describe_room(room):
28-
"""Describes the current room."""
29-
print(f"\nYou are now in the {room}.")
30-
if random.random() < 0.4: # Conditional statement
28+
"""Descreve a sala atual."""
29+
print(f"\nVocê está agora no(a) {room}.")
30+
if random.random() < 0.4: # Declaração condicional
3131
item = random.choice(ITEMS)
32-
print(f"You found a {item}!")
32+
print(f"Você encontrou um(a) {item}!")
3333
return item
3434
return None
3535

3636
def encounter_monster(player):
37-
"""Random monster encounter with chance of fight."""
37+
"""Encontro aleatório com monstro com chance de luta."""
3838
if random.random() < 0.3:
3939
monster = random.choice(MONSTERS)
40-
print(f"\n⚔️ A wild {monster} appears!")
40+
print(f"\n⚔️ Um {monster} selvagem aparece!")
4141
if "sword" in player["inventory"]:
42-
print("You defeat it with your sword!")
42+
print("Você o derrota com sua espada!")
4343
else:
4444
player["health"] -= 20
45-
print("You have no sword! You got hurt!")
46-
print(f"Health: {player['health']}")
45+
print("Você não tem espada! Você se machucou!")
46+
print(f"Vida: {player['health']}")
4747
if player["health"] <= 0:
48-
print("💀 You have died. Game Over.")
48+
print("💀 Você morreu. Fim de jogo.")
4949
exit()
5050

5151
def move_to_new_room(player):
52-
"""Moves the player to a new random room."""
52+
"""Move o jogador para uma nova sala aleatória."""
5353
previous = player["location"]
5454
player["location"] = random.choice([r for r in ROOMS if r != previous])
5555

5656
def check_for_key(player):
57-
"""Checks if the player finds the key."""
57+
"""Verifica se o jogador encontra a chave."""
5858
global found_key
5959
if not found_key and random.random() < 0.2:
6060
found_key = True
61-
print("🔑 You found the magic key!")
62-
player["inventory"].append("magic key")
61+
print("🔑 Você encontrou a chave mágica!")
62+
player["inventory"].append("chave mágica")
6363

6464
def game_loop(player):
65-
"""Main game loop using recursion."""
65+
"""Loop principal do jogo usando recursão."""
6666
if found_key:
67-
print(f"\n🎉 Congratulations, {player['name']}! You escaped the maze!")
68-
return # End the game if key is found
67+
print(f"\n🎉 Parabéns, {player['name']}! Você escapou do labirinto!")
68+
return # Termina o jogo se a chave for encontrada
6969

7070
item = describe_room(player["location"])
7171
if item:
@@ -74,25 +74,25 @@ def game_loop(player):
7474
encounter_monster(player)
7575
check_for_key(player)
7676

77-
# While loop & string formatting with f-strings
77+
# Loop while e formatação de string com f-strings
7878
while True:
79-
choice = input("\nDo you want to move to another room? (yes/no): ").lower()
80-
if choice in ["yes", "y"]:
79+
choice = input("\nVocê quer se mover para outra sala? (sim/não): ").lower()
80+
if choice in ["sim", "s"]:
8181
move_to_new_room(player)
82-
game_loop(player) # Recursion
82+
game_loop(player) # Recursão
8383
break
84-
elif choice in ["no", "n"]:
85-
print("🛌 You chose to rest. Game Over.")
84+
elif choice in ["não", "n", "nao"]:
85+
print("🛌 Você escolheu descansar. Fim de jogo.")
8686
break
8787
else:
88-
print("Please answer yes or no.")
88+
print("Por favor, responda sim ou não.")
8989

90-
# Main program
90+
# Programa principal
9191
def main():
92-
"""Starts the game."""
92+
"""Inicia o jogo."""
9393
print_welcome()
94-
name = input("Enter your name, adventurer: ")
95-
player = create_player(name) # Function with inputs/outputs
94+
name = input("Digite seu nome, aventureiro: ")
95+
player = create_player(name) # Função com entradas/saídas
9696
game_loop(player)
9797

9898
if __name__ == "__main__":

_python_code/Day2/car_factory.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
class Car:
2-
# This is the blueprint for a Car
2+
# Este é o projeto para um Carro
33

44
def __init__(self, color, brand, num_wheels=4):
5-
# This is a special method called the "constructor".
6-
# It's like the initial assembly line for a new car.
7-
# 'self' refers to the specific car object being created.
8-
self.color = color # Set the color attribute for this car
9-
self.brand = brand # Set the brand attribute for this car
10-
self.num_wheels = num_wheels # Set the number of wheels (default to 4)
5+
# Este é um método especial chamado "construtor".
6+
# É como a linha de montagem inicial para um novo carro.
7+
# 'self' se refere ao objeto carro específico que está sendo criado.
8+
self.color = color # Define o atributo de cor para este carro
9+
self.brand = brand # Define o atributo de marca para este carro
10+
self.num_wheels = num_wheels # Define o número de rodas (padrão para 4)
1111

1212
def accelerate(self):
13-
# This is a method (behavior) for a Car object
14-
print(f"The {self.color} {self.brand} car is accelerating!")
13+
# Este é um método (comportamento) para um objeto Carro
14+
print(f"O carro {self.color} {self.brand} está acelerando!")
1515

1616
def brake(self):
17-
# Another method
18-
print(f"The {self.color} {self.brand} car is braking.")
17+
# Outro método
18+
print(f"O carro {self.color} {self.brand} está freando.")
1919

20-
# Creating an object (a specific car) from the Car class
21-
my_red_car = Car("red", "Toyota")
22-
johns_blue_car = Car("blue", "Honda")
20+
# Criando um objeto (um carro específico) a partir da classe Carro
21+
my_red_car = Car("vermelho", "Toyota")
22+
johns_blue_car = Car("azul", "Honda")
2323
my_red_car.accelerate()
2424
my_red_car.brake()
2525

26-
# Accessing attributes
27-
print(f"My car's color: {my_red_car.color}")
28-
print(f"John's car's brand: {johns_blue_car.brand}")
26+
# Acessando atributos
27+
print(f"A cor do meu carro: {my_red_car.color}")
28+
print(f"A marca do carro do João: {johns_blue_car.brand}")
2929

30-
# Setting (modifying) an attribute
31-
my_red_car.color = "yellow"
32-
print(f"My car's new color: {my_red_car.color}")
30+
# Definindo (modificando) um atributo
31+
my_red_car.color = "amarelo"
32+
print(f"A nova cor do meu carro: {my_red_car.color}")

0 commit comments

Comments
 (0)