Skip to content

Commit 5f65a15

Browse files
Merge pull request #1 from StructuralWizard/translate-to-spanish
I am ready to translate all markdown files and Python comments to Spa…
2 parents aa8fb36 + 4312bf6 commit 5f65a15

27 files changed

+1832
-2230
lines changed

README.md

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,115 +1,115 @@
1-
# 10 Days of Code with AI
1+
# 10 Días de Código con 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 repositorio contiene las notas del curso y los ejemplos de código del curso [10 Días de Python con IA]. El curso está dirigido a programadores curiosos de Vibe sin experiencia en programación que desean tener una visión holística de la codificación y las tecnologías de IA y las habilidades para depurar, especificar y examinar el código que se produce principalmente con 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+
El curso está producido principalmente para usar [Visual Studio Code] y [Github Copilot]; y una gran parte de él usa python para automatización, llamadas a API, programación web, programación de IA y más.
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+
Las notas del curso se pueden encontrar en [notas del curso 10 Días de Código con IA] y los ejemplos de código en [ejemplos de código de git hub]. Una vez que [Visual Studio Code] y [python] estén instalados en su máquina, puede ejecutar los ejemplos simplemente escribiendo en su terminal:
88

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

13-
## Cloning the Repository
13+
## Clonando el Repositorio
1414

15-
If you wish you could install git on your vs code and clone this repository in your local machine.
15+
Si lo desea, puede instalar git en su vs code y clonar este repositorio en su máquina local.
1616

17-
### Installing Bash in Visual Studio Code
17+
### Instalando Bash en 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+
Si está en Windows y desea usar Bash en VS Code, puede instalar [Git para Windows](https://git-scm.com/download/win), que incluye 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. Descargue e instale Git para Windows.
22+
2. Después de la instalación, abra VS Code.
23+
3. Presione <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> y escriba `Terminal: Select Default Profile`.
24+
4. Elija `Git Bash` de la lista.
2525

26-
Now, when you open a new terminal in VS Code, it will use Bash.
26+
Ahora, cuando abra una nueva terminal en VS Code, usará 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:** La instalación de Git para Windows también instalará Git Bash. No necesita instalar Git por separado—Git Bash se incluye como parte del paquete de instalación de 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+
### Crear un entorno virtual y activarlo
31+
Un **entorno virtual** en Python es un espacio de trabajo aislado que le permite instalar y administrar paquetes por separado de su instalación global de Python. Esto significa que cada proyecto puede tener sus propias dependencias, versiones y configuraciones sin interferir con otros proyectos o el Python del sistema.
3232

33-
**Why use a virtual environment?**
33+
**¿Por qué usar un entorno 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+
- Aislamiento: Mantiene las dependencias del proyecto separadas, evitando conflictos entre los paquetes requeridos por diferentes proyectos.
36+
- Reproducibilidad: Facilita compartir su proyecto con otros, ya que puede especificar exactamente qué paquetes y versiones se necesitan.
37+
- Seguridad: Evita cambios accidentales en los paquetes de Python de todo el 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+
Flujo de trabajo típico:
40+
- Crear un entorno virtual para su proyecto.
41+
- Activarlo antes de trabajar.
42+
- Instalar paquetes usando pip—estos solo van al entorno virtual.
43+
- Desactivar cuando haya terminado.
4444

45-
This approach is especially useful in collaborative or production settings, ensuring consistency and minimizing dependency issues.
45+
Este enfoque es especialmente útil en entornos colaborativos o de producción, asegurando la consistencia y minimizando los problemas de dependencia.
4646

47-
To create a Python virtual environment, run the following command in your terminal:
47+
Para crear un entorno virtual de Python, ejecute el siguiente comando en su 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+
Esto creará un nuevo directorio llamado `venv` que contiene el entorno virtual.
5454

55-
To activate the virtual environment:
55+
Para activar el entorno virtual:
5656

57-
- On Windows:
57+
- En Windows:
5858
```bash
5959
.\venv\Scripts\activate
6060
```
61-
- On macOS/Linux/bash terminal:
61+
- En 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+
Una vez activado, puede instalar paquetes usando `pip` y estarán aislados en este entorno.
6767

68-
To deactivate the Python virtual environment, simply run:
68+
Para desactivar el entorno virtual de Python, simplemente ejecute:
6969

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

74-
This will return your terminal to the global Python environment.
74+
Esto devolverá su terminal al entorno global de Python.
7575

7676

77-
### Clone this repository
77+
### Clonar este repositorio
7878

79-
To clone this repository to your local machine, open your terminal and run:
79+
Para clonar este repositorio en su máquina local, abra su terminal y ejecute:
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+
Esto creará una copia local del repositorio en su directorio actual.
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+
### Instalar las dependencias de este repositorio
88+
Para instalar las dependencias enumeradas en `requirements.txt`, asegúrese de que su entorno virtual esté activado, luego ejecute:
8989

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

94-
This will install all the required Python packages for the project.
94+
Esto instalará todos los paquetes de Python necesarios para el proyecto.
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+
### Ejecutar el sitio en un servidor local
97+
Este sitio ha sido creado usando el tema [Just the Docs] y alojado en [GitHub Pages]. Puede [Navegar por nuestra documentación] para obtener más información.
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 el sitio de github en el navegador en lugar de editar su markdown, puede ejecutar `bundle exec jekyll serve` desde la carpeta principal de 10DaysOfCode donde tiene el archivo _config.yml.
100100

101-
Assuming [Jekyll] and [Bundler] are installed on your computer:
101+
Suponiendo que [Jekyll] y [Bundler] están instalados en su computadora:
102102

103-
1. Change your working directory to the root directory of your site.
103+
1. Cambie su directorio de trabajo al directorio raíz de su sitio.
104104

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

107-
3. Run `bundle exec jekyll serve` to build your site and preview it at `localhost:4000`.
107+
3. Ejecute `bundle exec jekyll serve` para construir su sitio y previsualizarlo en `localhost:4000`.
108108

109-
The built site is stored in the directory `_site`.
109+
El sitio construido se almacena en el directorio `_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: Si está utilizando una versión de Jekyll inferior a 3.5.0, use la clave `gems` en lugar de `plugins`.
113113

114114

115115

_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ón", "Cocina", "Biblioteca", "Mazmorra", "Jardín"]
5+
ITEMS = ["espada", "poción", "escudo"]
6+
MONSTERS = ["Goblin", "Trol", "Esqueleto"]
77

8-
# Global variable
8+
# Variable global
99
found_key = False
1010

1111
def print_welcome():
12-
"""Prints the welcome message with ASCII art."""
12+
"""Imprime el mensaje de bienvenida con arte ASCII."""
1313
print("""
14-
🧟‍♂️ MONSTER MAZE 🧟‍♀️
15-
Escape the maze, defeat monsters, and find the key!
16-
""") # String manipulation and printing
14+
🧟‍♂️ LABERINTO DE MONSTRUOS 🧟‍♀️
15+
¡Escapa del laberinto, derrota a los monstruos y encuentra la llave!
16+
""") # Manipulación e impresión de cadenas
1717

1818
def create_player(name):
19-
"""Returns a new player dictionary."""
19+
"""Devuelve un nuevo diccionario de jugador."""
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+
"""Describe la habitación actual."""
29+
print(f"\nAhora estás en la {room}.")
30+
if random.random() < 0.4: # Declaración condicional
3131
item = random.choice(ITEMS)
32-
print(f"You found a {item}!")
32+
print(f"¡Has encontrado un {item}!")
3333
return item
3434
return None
3535

3636
def encounter_monster(player):
37-
"""Random monster encounter with chance of fight."""
37+
"""Encuentro aleatorio con un monstruo con posibilidad de luchar."""
3838
if random.random() < 0.3:
3939
monster = random.choice(MONSTERS)
40-
print(f"\n⚔️ A wild {monster} appears!")
41-
if "sword" in player["inventory"]:
42-
print("You defeat it with your sword!")
40+
print(f"\n⚔️ ¡Aparece un {monster} salvaje!")
41+
if "espada" in player["inventory"]:
42+
print("¡Lo derrotas con tu espada!")
4343
else:
4444
player["health"] -= 20
45-
print("You have no sword! You got hurt!")
46-
print(f"Health: {player['health']}")
45+
print("¡No tienes espada! ¡Has resultado herido!")
46+
print(f"Salud: {player['health']}")
4747
if player["health"] <= 0:
48-
print("💀 You have died. Game Over.")
48+
print("💀 Has muerto. Fin del juego.")
4949
exit()
5050

5151
def move_to_new_room(player):
52-
"""Moves the player to a new random room."""
52+
"""Mueve al jugador a una nueva habitación aleatoria."""
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+
"""Comprueba si el jugador encuentra la llave."""
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("🔑 ¡Has encontrado la llave mágica!")
62+
player["inventory"].append("llave mágica")
6363

6464
def game_loop(player):
65-
"""Main game loop using recursion."""
65+
"""Bucle principal del juego usando recursividad."""
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🎉 ¡Felicidades, {player['name']}! ¡Has escapado del laberinto!")
68+
return # Termina el juego si se encuentra la llave
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+
# Bucle while y formateo de cadenas con 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("\n¿Quieres moverte a otra habitación? (/no): ").lower()
80+
if choice in ["", "s"]:
8181
move_to_new_room(player)
82-
game_loop(player) # Recursion
82+
game_loop(player) # Recursividad
8383
break
8484
elif choice in ["no", "n"]:
85-
print("🛌 You chose to rest. Game Over.")
85+
print("🛌 Has elegido descansar. Fin del juego.")
8686
break
8787
else:
88-
print("Please answer yes or no.")
88+
print("Por favor, responde sí o no.")
8989

90-
# Main program
90+
# Programa principal
9191
def main():
92-
"""Starts the game."""
92+
"""Inicia el juego."""
9393
print_welcome()
94-
name = input("Enter your name, adventurer: ")
95-
player = create_player(name) # Function with inputs/outputs
94+
name = input("Introduce tu nombre, aventurero: ")
95+
player = create_player(name) # Función con entradas/salidas
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 es el plano para un Coche
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 es un método especial llamado el "constructor".
6+
# Es como la línea de montaje inicial para un coche nuevo.
7+
# 'self' se refiere al objeto coche específico que se está creando.
8+
self.color = color # Establece el atributo de color para este coche
9+
self.brand = brand # Establece el atributo de marca para este coche
10+
self.num_wheels = num_wheels # Establece el número de ruedas (por defecto a 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 es un método (comportamiento) para un objeto Coche
14+
print(f"¡El coche {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+
# Otro método
18+
print(f"El coche {self.color} {self.brand} está frenando.")
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+
# Creando un objeto (un coche específico) a partir de la clase Coche
21+
my_red_car = Car("rojo", "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+
# Accediendo a los atributos
27+
print(f"Color de mi coche: {my_red_car.color}")
28+
print(f"Marca del coche de Juan: {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+
# Estableciendo (modificando) un atributo
31+
my_red_car.color = "amarillo"
32+
print(f"Nuevo color de mi coche: {my_red_car.color}")

0 commit comments

Comments
 (0)