Skip to content

Commit 95176e8

Browse files
authored
Merge pull request #93 from josemoracard/jose4-05-user-inputed-values
exercises 05-user-inputed-values to 19-bottles-of-milk
2 parents edd518f + 597414d commit 95176e8

File tree

70 files changed

+320
-285
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+320
-285
lines changed

exercises/05-User-Inputed-Values/README.es.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
Otra cosa genial de las variables es que no necesitas saber su valor para poder trabajar con ellas.
44

5-
Por ejemplo, justo ahora la aplicación está preguntando la edad del usuario, y luego la imprime en la cónsola.
5+
Por ejemplo, justo ahora la aplicación está preguntando la edad del usuario, y luego la imprime en la consola.
66

77
## 📝 Instrucciones:
88

99
1. Por favor, añade 10 años al valor de la variable `age`.
1010

11-
## 💡 Pista:
11+
## 💡 Pistas:
1212

1313
+ Puedes buscar en Google "Como sumarle una cantidad a una variable de Python".
1414

15-
+ Recuerda que el contenido de la variable está siendo definido con lo que sea que el usuario coloque.
15+
+ Recuerda que el contenido de la variable está siendo definido con lo que sea que el usuario coloque.

exercises/05-User-Inputed-Values/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ For example, the application right now is prompting the user for its age, and th
1212

1313
1. Please add 10 years to the value of the age variable.
1414

15-
## 💡Hint
15+
## 💡 Hints:
1616

17-
+ You can Google "how to add a number to a python variable".
17+
+ You can Google "how to add a number to a Python variable".
1818

19-
+ Remember that the content of the variable its being previously filled with whatever the user inputs.
19+
+ Remember that the content of the variable is being previously filled with whatever the user inputs.

exercises/05-User-Inputed-Values/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def test_for_file_output(capsys):
99
regex = re.compile(pattern)
1010
assert bool(regex.search(content)) == True
1111

12-
@pytest.mark.it("We tried with age 50 and it was supposed to return 60")
12+
@pytest.mark.it("Testing with age 50 and it is supposed to return 60")
1313
@mock.patch('builtins.input', lambda x: 50)
1414
def test_plus_ten(stdin):
1515
# f = open(os.path.dirname(os.path.abspath(__file__))+'/app.py')

exercises/06-String-Concatenation/README.es.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ Puedes pensar en este proceso como conectar dos o más vagones de tren. Si cada
77
En Python, puedes concatenar o unir dos o más strings usando el operador `+`. Así es como funciona:
88

99
```py
10-
1110
one = 'a'
1211
two = 'b'
13-
print(one + two) # esto imprimirá 'ab' en la consola.
12+
print(one + two) # Esto imprimirá 'ab' en la consola.
1413
```
1514

1615
Aquí, las variables `one` y `two` contienen los strings individuales `'a'` y `'b'`, respectivamente. Cuando usas el operador `+` entre ellos, actúa como un pegamento, uniendo los strings de extremo a extremo. En este caso, une `'a'` y `'b'`, dando como resultado el string concatenado `'ab'`, que se imprime en la consola.
@@ -20,4 +19,4 @@ Aquí, las variables `one` y `two` contienen los strings individuales `'a'` y `'
2019

2120

2221
## 💡 Pista:
23-
+ Si necesitas más explicación sobre como la **concatenación** funciona en Python, puedes ver este clip: https://www.youtube.com/watch?v=T1nyPuAhd1U&ab_channel=ProgramaResuelto (`ctrl + click` en el enlance para abrir el video)
22+
+ Si necesitas más explicación sobre como funciona la **concatenación** en Python, puedes ver este clip: https://www.youtube.com/watch?v=T1nyPuAhd1U&ab_channel=ProgramaResuelto (`ctrl + click` en el enlace para abrir el video)

exercises/06-String-Concatenation/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,15 @@ You can think of this process as similar to connecting two or more train cars. I
1111
In Python, you can concatenate, or join together, two or more strings using the `+` operator. This is how it works:
1212

1313
```py
14-
1514
one = 'a'
1615
two = 'b'
17-
print(one + two) # this will print 'ab' on the console.
16+
print(one + two) # This will print 'ab' on the console.
1817
```
1918

2019
Here, the variables `one` and `two` hold the individual strings `'a'` and `'b'`. When you use the `+` operator between them, it acts like a glue, sticking the strings together end-to-end. In this case, it joins `'a'` and `'b'`, resulting in the concatenated string `'ab'`, which gets printed to the console.
2120

2221
## 📝 Instructions:
23-
1. Set the values for `my_var1` and `my_var2` so that when concatenated, the code prints `Hello World` in the console.
22+
1. Set the values for `my_var1` and `my_var2` so that, when concatenated, the code prints `Hello World` in the console.
2423

2524
## 💡 Hint:
26-
+ If you need further explanation on how string **concatenation** works in python, you can watch this clip: https://www.youtube.com/watch?v=28FUVmWU_fA&ab_channel=PortfolioCourses (`ctrl + click` on the link to open the video)
25+
+ If you need further explanation on how string **concatenation** works in Python, you can watch this clip: https://www.youtube.com/watch?v=28FUVmWU_fA&ab_channel=PortfolioCourses (`ctrl + click` on the link to open the video)
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ✅ ↓ Set the values for my_var1 and my_var2 here ↓ ✅
22

33

4-
## Don't change below this line
5-
the_new_string = my_var1+' '+my_var2
6-
print(the_new_string)
4+
## Don't change anything below this line
5+
the_new_string = my_var1 + ' ' + my_var2
6+
print(the_new_string)

exercises/06-String-Concatenation/solution.hide.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
my_var1 = "Hello"
44
my_var2 = "World"
55

6-
## Don't change below this line
7-
the_new_string = my_var1+' '+my_var2
8-
print(the_new_string)
6+
## Don't change anything below this line
7+
the_new_string = my_var1 + ' ' + my_var2
8+
print(the_new_string)

exercises/06-String-Concatenation/test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def test_my_var2_value():
2727
from app import my_var2
2828
assert my_var2.lower() == "world"
2929

30-
@pytest.mark.it("Variable my_var2 value should be 'World'")
30+
@pytest.mark.it("Don't remove the_new_string variable")
3131
def test_the_new_string_exists():
3232
import app
3333
try:
@@ -38,4 +38,4 @@ def test_the_new_string_exists():
3838
@pytest.mark.it('Print "Hello World" on the console')
3939
def test_for_file_output():
4040
captured = buffer.getvalue()
41-
assert "hello world\n" in captured.lower() #add \n because the console jumps the line on every print
41+
assert "hello world\n" in captured.lower() #add \n because the console jumps the line on every print

exercises/07-Create-a-Basic-HTML/README.es.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,17 @@ Continuemos concatenando strings para generar un documento HTML básico...
44

55
## 📝 Instrucciones:
66

7-
1. Crea una variable **html_document**.
7+
1. Crea la variable `html_document`.
88

9-
2. El código a la izquierda contiene 8 variables con diferentes valores de tipo *string*. Por favor, usa las variables concatenándolas entre ellas para establecer el valor de la variable **html_document** como nuevo string que tenga el contenido de un documento HTML típico (con las etiquetas HTML
10-
en el orden correcto).
9+
2. El código a la izquierda contiene 8 variables con diferentes valores de tipo *string*. Por favor, usa las variables concatenándolas entre ellas para establecer el valor de la variable `html_document` a la estructura típica de un documento HTML (con las etiquetas HTML en el orden correcto).
1110

12-
3. Luego, imprime el valor de **html_document** en la consola.
11+
3. Luego, imprime el valor de `html_document` en la consola.
1312

1413
## 💡 Pista:
1514

1615
+ Resultado esperado:
1716

18-
```sh
19-
17+
```html
2018
<html><head><title></title></head><body></body></html>
2119
```
2220

exercises/07-Create-a-Basic-HTML/README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,24 @@
22
tutorial: "https://www.youtube.com/watch?v=j14V-eS8mRg"
33
---
44

5-
# `07` Create a basic HTML
5+
# `07` Create a Basic HTML
66

77
Let's continue using string concatenation to generate HTML...
88

99
## 📝 Instructions:
1010

11-
1. Create a variable **html_document**.
11+
1. Create the variable `html_document`.
1212

13-
2. The code on the left contains 8 variables with different string values, please use the variables concatenating them together to set the value of the variable **html_document**
14-
a new string that has the content of a typical HTML document (with the HTML tags in the
15-
right order).
13+
2. The code on the left contains 8 variables with different string values, please use the variables concatenating them together to set the value of the variable `html_document`
14+
to a new string that has the content of a typical HTML document (with the HTML tags in the right order).
1615

17-
3. Then, print the value of **html_document** on the console.
16+
3. Then, print the value of `html_document` on the console.
1817

1918
## 💡 Hint:
2019

2120
+ Expected Result:
2221

23-
```sh
24-
22+
```html
2523
<html><head><title></title></head><body></body></html>
2624
```
2725

0 commit comments

Comments
 (0)