Skip to content

exercises 00-welcome to 04-Multiply-Two-Values #92

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Dec 6, 2023
Merged
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
11 changes: 5 additions & 6 deletions exercises/00-Welcome/README.es.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ¡Bienvenido al curso inicial de Python!
# Welcome to the Python Beginner Course!

¡Estamos muy entusiasmados por tenerte aquí! 🎉 😂

Expand All @@ -12,7 +12,7 @@ Durante este curso aprenderás los siguientes conceptos:

3. Cómo concatenar strings.

4. Cómo usar bucles(loops) y declaraciones if.
4. Cómo usar bucles (loops) y declaraciones if...else.

5. Cómo combinar y usar todos estos conceptos de diferentes formas.

Expand All @@ -28,16 +28,15 @@ Por favor, haz clic en el botón `Next →` arriba a la derecha para dirigirte a

+ [https://youtu.be/lc5JJTQa4r8](https://youtu.be/lc5JJTQa4r8)


## Colaboradores:

Gracias a estas maravillosas personas ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):

1. [Alejandro Sánchez (alesanchezr)](https://github.com/alesanchezr), contribución: (programador) :computer: (idea) 🤔, (build-tests) :warning:, (pull-request-review) :eyes: (build-tutorial) :white_check_mark: (documentación) :book:
1. [Alejandro Sánchez (alesanchezr)](https://github.com/alesanchezr), contribución: (programador) 💻, (idea) 🤔, (build-tests) ⚠️, (pull-request-review) 🤓, (build-tutorial) ✅, (documentación) 📖

2. [Paolo Lucano (plucodev)](https://github.com/plucodev), contribución: (programador) :computer:, (build-tests) :warning:
2. [Paolo Lucano (plucodev)](https://github.com/plucodev), contribución: (programador) 💻, (build-tests) ⚠️

3. [Marco Gómez (marcogonzalo)](https://github.com/marcogonzalo), contribución: (traducción) :earth_africa:
3. [Marco Gómez (marcogonzalo)](https://github.com/marcogonzalo), contribución: (traducción) 🌎

Este proyecto sigue las especificaciones: [all-contributors](https://github.com/kentcdodds/all-contributors).

Expand Down
12 changes: 6 additions & 6 deletions exercises/00-Welcome/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
intro: "https://www.youtube.com/watch?v=amyDNhZwGJQ"
---

# Welcome to Python Beginner Course!
# Welcome to the Python Beginner Course!

We are very excited to have you here! 🎉 😂

## 💬 Fundamentals:

During this course you will be learning the following concepts:
During this course, you will be learning the following concepts:

1. How to create and call functions.

Expand All @@ -24,7 +24,7 @@ Please click on the `Next →` button on the top right to proceed to the first c

## Useful Readings:

+ [https://www.w3schools.com/python/python_intro.asp#:~:text=Python%20has%20a%20simple%20syntax,prototyping%20can%20be%20very%20quick.](https://www.w3schools.com/python/python_intro.asp#:~:text=Python%20has%20a%20simple%20syntax,prototyping%20can%20be%20very%20quick.)
+ [https://www.w3schools.com/python/python_intro.asp](https://www.w3schools.com/python/python_intro.asp)

+ [https://www.python.org/doc/essays/blurb/](https://www.python.org/doc/essays/blurb/)

Expand All @@ -36,11 +36,11 @@ Please click on the `Next →` button on the top right to proceed to the first c

Thanks to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):

1. [Alejandro Sanchez (alesanchezr)](https://github.com/alesanchezr), contribution: (coder) :computer: (idea) 🤔, (build-tests) :warning:, (pull-request-review) :eyes: (build-tutorial) :white_check_mark: (documentation) :book:
1. [Alejandro Sanchez (alesanchezr)](https://github.com/alesanchezr), contribution: (coder) 💻, (idea) 🤔, (build-tests) ⚠️, (pull-request-review) 🤓, (build-tutorial) ✅, (documentation) 📖

2. [Paolo Lucano (plucodev)](https://github.com/plucodev), contribution: (coder), (build-tests) :warning:
2. [Paolo Lucano (plucodev)](https://github.com/plucodev), contribution: (coder) 💻, (build-tests) ⚠️

3. [Marco Gómez (marcogonzalo)](https://github.com/marcogonzalo), contribution: (translator) :earth_africa:
3. [Marco Gómez (marcogonzalo)](https://github.com/marcogonzalo), contribution: (translator) 🌎


This project follows these specifications: [all-contributors](https://github.com/kentcdodds/all-contributors)
Expand Down
6 changes: 3 additions & 3 deletions exercises/01-Console/README.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

En Python, usamos **print** para que el computador escriba cualquier cosa que queramos (el contenido de una variable, una string dado, etc.) en algo llamado "la consola".

Cada lenguaje de programación tiene una consola, ya que al principio era la única forma de interactuar con los usuarios (antes de que llegaran Windows, Linux o MacOS).
Cada lenguaje de programación tiene una consola, ya que al principio era la única forma de interactuar con los usuarios (antes de que llegaran Windows, Linux o macOS).

Hoy en día, la impresión en la consola se utiliza, sobre todo, como herramienta de monitoreo y depuración, ideal para dejar un rastro del contenido de las variables durante la ejecución del programa.

Expand All @@ -14,12 +14,12 @@ print("Un texto en la consola")

## 📝 Instrucciones:

1. usa **print** para escribir `Hello World!` en la consola.
1. usa `print()` para escribir `Hello World!` en la consola.

## 💡 Pistas:

+ Recuerda, para ejecutar el código y ver el resultado en la consola, haz clic en el ícono de caja en la esquina superior izquierda de la pantalla:

https://i.imgur.com/w6u4aDd.png
![Botón de compilar](https://i.imgur.com/w6u4aDd.png)

+ Siéntete libre de intentar otras cosas también.
8 changes: 4 additions & 4 deletions exercises/01-Console/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ tutorial: "https://www.youtube.com/watch?v=2sV-2frucUs"

In Python, we use **print** to make the computer write anything we want (the content of a variable, a given string, etc.) in something called "the console".

Every programming language has a console, as it was the only way to interact with the users at the beginning (before Windows or MacOS arrived).
Every programming language has a console, as it was the only way to interact with the users at the beginning (before Windows, Linux or macOS arrived).

Today, printing in the console is used mostly as a monitoring and debugging tool, ideal to leave a trace of the content of variables during the program execution.
Today, printing in the console is mostly used as a monitoring and debugging tool, ideal for leaving a trace of the content of variables during the program's execution.

This is an example of how to use it:

Expand All @@ -18,13 +18,13 @@ print("How are you?")

## 📝 Instructions:

1. Use **print** to print `Hello World!` on the console.
1. Use `print()` to print `Hello World!` on the console.


## 💡 Hints:

+ Remember, to run the code and see the output on the console, click on the box icon in the top left of the screen:

https://i.imgur.com/w6u4aDd.png
![The compile button](https://i.imgur.com/w6u4aDd.png)

+ Feel free to try other things as well.
6 changes: 3 additions & 3 deletions exercises/02-Declare-Variables/README.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ En la programación, usamos variables como si fueran cajas (o contenedores) para
name = "Daniel"
```

En este ejemplo, `name` es la variable, actuando como una caja para almacenar el valor `"Daniel"`. Dentro de esta 'caja', estamos almacenando el valor `"Daniel"`, y podemos usar `name` para referirnos a este valor más tarde. Al nombrar tus variables, puedes elegir casi cualquier nombre, pero debe comenzar con una letra o un guión bajo (`_`). Es útil elegir un nombre que describa lo que hay dentro de la 'caja' para que puedas entender fácilmente lo que representa más adelante.
En este ejemplo, `name` es la variable, actuando como una caja para almacenar el valor `"Daniel"`. Dentro de esta 'caja', estamos almacenando el valor `"Daniel"`, y podemos usar `name` para referirnos a este valor más tarde. Al nombrar tus variables, puedes elegir casi cualquier nombre, pero debe comenzar con una letra o un guion bajo (`_`). Es útil elegir un nombre que describa lo que hay dentro de la 'caja' para que puedas entender fácilmente lo que representa más adelante.

## 📝 Instrucciones:

1. Declara una variable con el valor `"Yellow"` y luego imprímelo en la consola.

2. Luego, imprime su valor en la consola usando `print(name)`.

## 💡 Pista:
## 💡 Pistas:

+ Puedes darle el nombre que quieras a la variable, pero su valor tiene que ser el texto "Yellow".

+ Si necesitas más explicación sobre qué son los **strings** y cómo funcionan en Python, puedes ver este clip: https://www.youtube.com/watch?v=yT0jixU3M2c&ab_channel=ProgramaResuelto (`ctrl + click` en el enlance para abrir el video)
+ Si necesitas más explicación sobre qué son los **strings** y cómo funcionan en Python, puedes ver este clip: https://www.youtube.com/watch?v=yT0jixU3M2c&ab_channel=ProgramaResuelto (`ctrl + click` en el enlace para abrir el video)
5 changes: 3 additions & 2 deletions exercises/02-Declare-Variables/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ In this example, `name` is the variable, acting like a box to store the value `"

2. Then, print its value on the console using `print(name)`.

## 💡 Hint:
## 💡 Hints:

+ The name of the variable can be whatever you want, but the value inside has to be the string "Yellow".
+ If you need further explanation on what **strings** are and how they work in python, you can watch this clip: https://youtube.com/clip/UgkxyQ_JLmgSUL4l25c8Ly7cCRvk1Gm-EchU (`ctrl + click` on the link to open the video)

+ If you need further explanation on what **strings** are and how they work in Python, you can watch this clip: https://youtube.com/clip/UgkxyQ_JLmgSUL4l25c8Ly7cCRvk1Gm-EchU (`ctrl + click` on the link to open the video)
13 changes: 7 additions & 6 deletions exercises/03-Print-Variables-In-The-Console/README.es.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# `03` Print Variables in The Console
# `03` Print more Variables in The Console

También puedes usar la función **print** para imprimir variables en la consola. Es una excelente forma de verificar su valor actual, así:
También puedes imprimir más de una variable en la misma función `print()` separando con una coma `,` las variables a imprimir. De esta manera:

```py
my_super_variable = 'hello'
print(my_super_variable)
my_variable = 'hello'
my_second_variable = "world"
print(my_variable, my_second_variable) # --> hello world
```

## 📝 Instrucciones:

1. Declara una nueva variable llamada `color` y asígnale el valor `"red"`.
1. Declara dos nuevas variables llamadas `color` y `item` y asígnales el valor `"red"` y `marker` respectivamente.

2. Luego, imprime su valor en la consola (puede que tengas que desplazarte en la consola para poder verlo).
2. Luego, imprime sus valores en la consola (puede que tengas que desplazarte en la consola para poder verlo).
17 changes: 7 additions & 10 deletions exercises/03-Print-Variables-In-The-Console/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
---
tutorial: "https://www.youtube.com/watch?v=Ki1LaUKhPgU"
---
# `03` Print more Variables in the console

# `03` Print the Variables in the console

You can also use the **print** function to print variables in the console. It's a great way to check their current value, like this:
You can also print more than one variable in the same `print()` function by separating the variables with a comma `,`. Like this:

```py
my_super_variable = 'hello'
print(my_super_variable)
my_variable = 'hello'
my_second_variable = "world"
print(my_variable, my_second_variable) # --> hello world
```

## 📝 Instructions:

1. Declare a new variable called `color` and assign the value `"red"` to it.
1. Declare two new variables called `color` and `item`, and assign the value `"red"` and `"marker"` respectively to it.

2. Then, print its value on the console (you may have to scroll up in the terminal to see it!).
2. Then, print their values on the console (you may have to scroll up in the terminal to see it!).
3 changes: 2 additions & 1 deletion exercises/03-Print-Variables-In-The-Console/solution.hide.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# ✅ ↓ your code here ↓ ✅

color = "red"
print(color)
item = "marker"
print(color, item)
19 changes: 8 additions & 11 deletions exercises/03-Print-Variables-In-The-Console/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,20 @@
import pytest
import app
import os
import re

path = os.path.dirname(os.path.abspath(__file__))+'/app.py'

@pytest.mark.it("Create a variable named 'color' with the string value red")
@pytest.mark.it("Create a variable named 'color' with the string value 'red'")
def test_declare_variable():
result = app.color
assert result == "red"

@pytest.mark.it('Print on the console the value of the variable ')
def test_for_printing_variable():

with open(path, 'r') as content_file:
content = content_file.read()
regex = re.compile(r"print\s*\(\s*color\s*\)")
assert bool(regex.search(content)) == True
@pytest.mark.it("Create a variable named 'item' with the string value 'marker'")
def test_declare_variable():
result = app.item
assert result == "marker"

@pytest.mark.it('The printed value on the console should be "red"')
@pytest.mark.it('The printed value on the console should be "red marker"')
def test_for_file_output(capsys):
captured = buffer.getvalue()
assert "red\n" in captured
assert "red marker\n" in captured
4 changes: 2 additions & 2 deletions exercises/04-Multiply-Two-Values/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ tutorial: "https://www.youtube.com/watch?v=tATIrAWiLLU"

Any programming language lets you do basic Math operations like multiplication, division, etc.

To multiply 2 values in python, you have to use the asterisk operator like this:
To multiply 2 values in Python, you have to use the asterisk operator like this:

```py
resulting_value = 2 * 3
Expand All @@ -18,4 +18,4 @@ In this case, we stored the resulting value of the multiplication into a variabl

1. Please store the result of multiplying 2345 times 7323 in a variable called `variables_are_cool`.

2. Now print the result in the console.
2. Now print the result in the console.
4 changes: 2 additions & 2 deletions exercises/04-Multiply-Two-Values/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ def test_variable_exists():
except ImportError:
raise ImportError("The variable 'variables_are_cool' should exist on app.py")

@pytest.mark.it('Variables_are_cool value should be like 2345 * 7323 ')
@pytest.mark.it('The value of variables_are_cool should be 2345 * 7323')
def test_use_variable_name():
result = app.variables_are_cool == 17172435
assert result == True

@pytest.mark.it('Print on the console the variables_are_cool value ')
@pytest.mark.it('Print on the console the value of variables_are_cool')
def test_for_file_output(capsys):
captured = buffer.getvalue()
assert '17172435\n' in captured
Expand Down