Skip to content

Exercise enhancement q3 2023 - first 10 #86

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 84 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
ff7b881
clarified small discrepancy in readmes
UmiKami Jul 27, 2023
253f329
made test for flexible
UmiKami Jul 27, 2023
e73785d
made test flexible when comparing strings
UmiKami Jul 27, 2023
f5f111c
expanded on the explanation of what a variable is
UmiKami Jul 27, 2023
d2cca82
made test more flexible
UmiKami Jul 27, 2023
acfff08
added quotes to string value to avoid confusion
UmiKami Jul 27, 2023
2a7b76f
fixed small typo
UmiKami Jul 27, 2023
1468348
made string comparison more flexible on test
UmiKami Jul 27, 2023
259927e
test made more flexible
UmiKami Jul 27, 2023
b5d4805
made test more flexible
UmiKami Jul 27, 2023
68dfa54
made tests more flexible
UmiKami Jul 27, 2023
28a5b83
Made tests more flexible
UmiKami Jul 27, 2023
df3afa8
made tests more flexible
UmiKami Jul 27, 2023
b70a099
made test more flexible
UmiKami Jul 27, 2023
8aa3775
added note of common mistake to keep an eye out for
UmiKami Jul 27, 2023
2a39401
Improved explanation of what a variable is by actually using the "bo…
UmiKami Aug 2, 2023
777a941
return equality check on last test to how it was originally
UmiKami Aug 2, 2023
2abf3c4
made equality strictier
UmiKami Aug 2, 2023
62f5fef
fixed wrong test, first test is now back to original
UmiKami Aug 2, 2023
94b8e78
Removed note as it won't be necessary anymore
UmiKami Aug 2, 2023
7a9c51a
added in operator back
UmiKami Aug 2, 2023
bfef3c5
made equality stricter on tests 3 & 4, made it case insensitive
UmiKami Aug 2, 2023
8ad6d7b
added analogy for clarification and added additional resources under …
UmiKami Aug 2, 2023
d456f8f
moved hint about strings from number 6 to number 2
UmiKami Aug 3, 2023
5e59361
on test 2, assertion return to strict equality
UmiKami Aug 3, 2023
4d121c4
added hint on relational operators and improved wording in english fo…
UmiKami Aug 3, 2023
2a57988
Added visual cues for those people that may not understand English at…
UmiKami Aug 3, 2023
1341f0b
provided more clarity on as to what is expected
UmiKami Aug 3, 2023
2d8c5ba
made visual clues consistent
UmiKami Aug 3, 2023
52fdd8d
added visual cues
UmiKami Aug 3, 2023
2b6950f
updated visual clue instruction
UmiKami Aug 3, 2023
8c7c70f
enhanced explanation, added hints
UmiKami Aug 3, 2023
c89c386
added visual clues
UmiKami Aug 3, 2023
f614c03
fixed test that was not running because it shared the same function …
UmiKami Aug 3, 2023
f063296
added solution file
UmiKami Aug 3, 2023
b79e10b
added hints
UmiKami Aug 3, 2023
f6235e5
fixed test that was not running
UmiKami Aug 3, 2023
c4d6955
added additional visual cues
UmiKami Aug 3, 2023
152d43f
added visual cues
UmiKami Aug 3, 2023
10c582b
added solution file
UmiKami Aug 3, 2023
fab14ed
fixed typos / inconsistencies
UmiKami Aug 3, 2023
bc9e7af
added clarity to instructions
UmiKami Aug 3, 2023
ceeb9ec
added test to check if the user is using the print function
UmiKami Aug 3, 2023
b9a6574
added visual cues
UmiKami Aug 3, 2023
baebc5b
made test more flexible
UmiKami Aug 3, 2023
e1037a8
added visual cues
UmiKami Aug 3, 2023
461ab09
enhanced instructions by adding clarity to first step
UmiKami Aug 3, 2023
c37b10e
made test more flexible
UmiKami Aug 3, 2023
a5d3591
added more docs
UmiKami Aug 3, 2023
4cd4193
added visual cues
UmiKami Aug 3, 2023
b243129
added string check flexibility
UmiKami Aug 3, 2023
f3c2cd0
fixed example
UmiKami Aug 3, 2023
aae2ee1
removed label references
UmiKami Aug 3, 2023
f48643a
fixed wording
UmiKami Aug 3, 2023
f14f733
fixed placement of hints and arrows on app,.py
UmiKami Aug 3, 2023
3ab3b0e
fixed arrows not showing up, replaced with new arrows
UmiKami Aug 9, 2023
006c283
added visual cue
UmiKami Aug 9, 2023
aa75c50
added visual cues to keep consistency
UmiKami Aug 9, 2023
fa3315a
added visual cue
UmiKami Aug 9, 2023
c67db85
added visual cues
UmiKami Aug 9, 2023
b164832
added visual cue
UmiKami Aug 9, 2023
a754407
added visual cues
UmiKami Aug 9, 2023
96f74b9
updated visual cues on solution files
UmiKami Aug 9, 2023
9f80af3
added visual cues to solution file
UmiKami Aug 9, 2023
e50d682
added visual cues
UmiKami Aug 9, 2023
206dc3f
added visual cues
UmiKami Aug 9, 2023
5ac9734
added visual cue to solution file
UmiKami Aug 9, 2023
c942cba
added visual cues
UmiKami Aug 9, 2023
97d5bd6
added visual cues and removed answer from app,py
UmiKami Aug 9, 2023
ff9100e
added visual cues
UmiKami Aug 9, 2023
ebed545
added visual cues
UmiKami Aug 9, 2023
28a2d33
added small translation
UmiKami Aug 9, 2023
1a7e78d
added solution to file
UmiKami Aug 9, 2023
5ef1acc
removed small typo
UmiKami Aug 9, 2023
ae79647
added visual cues
UmiKami Aug 9, 2023
d9826da
added clarity to steps
UmiKami Aug 9, 2023
8025159
added visual cues
UmiKami Aug 9, 2023
5bc271f
added resources as a refresher of control flows
UmiKami Aug 9, 2023
12c064b
added visual cues
UmiKami Aug 9, 2023
223284a
added advise on how to use learnpack
UmiKami Aug 9, 2023
d3a224b
fixed typo
UmiKami Aug 9, 2023
02461d3
updated readme's by moving tip to where it should be
UmiKami Aug 10, 2023
73d6b63
Update README.es.md
UmiKami Aug 10, 2023
1e62d64
Update README.md
UmiKami Aug 10, 2023
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
12 changes: 10 additions & 2 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 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,4 +14,12 @@ print("Un texto en la consola")

## 📝 Instrucciones:

1. usa **print** para escribir `Hello World!` en la consola. Siéntete libre de intentar otras cosas también.
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

+ Siéntete libre de intentar otras cosas también.
13 changes: 11 additions & 2 deletions exercises/01-Console/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=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 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 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.

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

## 📝 Instructions:

1. Use **print** to print `Hello World!` on the console. Feel free to try other things as well.
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

+ Feel free to try other things as well.
2 changes: 1 addition & 1 deletion exercises/01-Console/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ def test_for_file_output(capsys):
@pytest.mark.it('Print Hello World! on the console')
def test_for_console_log(capsys):
captured = buffer.getvalue()
assert captured == "Hello World!\n" #add \n because the console jumps the line on every print
assert "Hello World!\n" in captured #add \n because the console jumps the line on every print

8 changes: 6 additions & 2 deletions exercises/02-Declare-Variables/README.es.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
# `02` Declare Variables

Las variables actúan como una caja (contenedor) que te permite almacenar distintos tipos de datos. Así es como se define una variable:
En la programación, usamos variables como si fueran cajas (o contenedores) para guardar diferentes tipos de información. Así es cómo creamos una variable:

```py
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.

## 📝 Instrucciones:

1. Declara una variable con el valor "Yellow" y luego imprímelo en la consola.
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:

+ 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)
7 changes: 5 additions & 2 deletions exercises/02-Declare-Variables/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,21 @@ tutorial: "https://www.youtube.com/watch?v=dWWvZkaPwDw"

# `02` Declare Variables

Variables act as a box (container) that lets you store different types of data. This is how we set a variable:
In programming, we use variables like boxes (or containers) to store different kinds of information. Here's how to create a variable:

```py
name = "Daniel"
```

In this example, `name` is the variable, acting like a box to store the value `"Daniel"`. Inside this 'box', we're storing the value `"Daniel"`, and we can use `name` to refer to it later. When naming your variables, you can choose almost any name, but it must begin with a letter or an underscore (`_`). It's helpful to pick a name that describes what's inside the 'box' so you can easily understand what it represents later on.

## 📝 Instructions:

1. Declare a new variable with the string value "Yellow" and print the value to the console.
1. Declare a new variable with the string value `"Yellow"` and print the value to the console.

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

## 💡 Hint:

+ 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)
2 changes: 1 addition & 1 deletion exercises/02-Declare-Variables/app.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# your code here
# ✅ ↓ your code here ↓ ✅
2 changes: 1 addition & 1 deletion exercises/02-Declare-Variables/solution.hide.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# your code here
# ✅ ↓ your code here ↓ ✅

color = "Yellow"
print(color)
2 changes: 1 addition & 1 deletion exercises/02-Declare-Variables/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ def test_for_variable():
@pytest.mark.it('Print the variable on the console')
def test_for_file_output(capsys):
captured = buffer.getvalue()
assert captured == "Yellow\n" #add \n because the console jumps the line on every print
assert "Yellow\n" in captured #add \n because the console jumps the line on every print


2 changes: 1 addition & 1 deletion exercises/03-Print-Variables-In-The-Console/README.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ print(my_super_variable)

## 📝 Instrucciones:

1. Declara una nueva variable llamada `color` y asígnale el valor `red`.
1. Declara una nueva variable llamada `color` y asígnale el valor `"red"`.

2. Luego, imprime su valor en la consola (puede que tengas que desplazarte en la consola para poder verlo).
2 changes: 1 addition & 1 deletion exercises/03-Print-Variables-In-The-Console/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ print(my_super_variable)

## 📝 Instructions:

1. Declare a new variable called `color` and assign the value `red` to it.
1. Declare a new variable called `color` and assign the value `"red"` to it.

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

color = "red"
print(color)
4 changes: 2 additions & 2 deletions exercises/03-Print-Variables-In-The-Console/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@pytest.mark.it("Create a variable named 'color' with the string value red")
def test_declare_variable():
result = app.color
assert result == "red"
assert result == "red"

@pytest.mark.it('Print on the console the value of the variable ')
def test_for_printing_variable():
Expand All @@ -24,4 +24,4 @@ def test_for_printing_variable():
@pytest.mark.it('The printed value on the console should be "red"')
def test_for_file_output(capsys):
captured = buffer.getvalue()
assert captured == "red\n"
assert "red\n" in captured
2 changes: 1 addition & 1 deletion exercises/04-Multiply-Two-Values/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ To multiply 2 values in python, you have to use the asterisk operator like this:
resulting_value = 2 * 3
```

In this case, we stored the result value of the multiplication into a variable called `resulting_value`.
In this case, we stored the resulting value of the multiplication into a variable called `resulting_value`.

## 📝 Instructions:

Expand Down
2 changes: 1 addition & 1 deletion exercises/04-Multiply-Two-Values/app.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# your code here
# ✅ ↓ your code here ↓ ✅
3 changes: 2 additions & 1 deletion exercises/04-Multiply-Two-Values/solution.hide.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# your code here
# ✅ ↓ your code here ↓ ✅

variables_are_cool = 2345 * 7323
print(variables_are_cool)
2 changes: 1 addition & 1 deletion exercises/04-Multiply-Two-Values/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def test_use_variable_name():
@pytest.mark.it('Print on the console the variables_are_cool value ')
def test_for_file_output(capsys):
captured = buffer.getvalue()
assert captured == '17172435\n'
assert '17172435\n' in captured

@pytest.mark.it('Print on the console the variables_are_cool variable')
def test_for_print():
Expand Down
2 changes: 1 addition & 1 deletion exercises/05-User-Inputed-Values/app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
age = int(input('What is your age?\n'))
# CHANGE THE CODE BELOW TO ADD 10 TO AGE
# ✅ ↓ CHANGE THE CODE BELOW TO ADD 10 TO AGE ↓ ✅

print("Your age is: "+str(age))
2 changes: 1 addition & 1 deletion exercises/05-User-Inputed-Values/solution.hide.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
age = int(input('What is your age?\n'))
# CHANGE THE CODE BELOW TO ADD 10 TO AGE
# ✅ ↓ CHANGE THE CODE BELOW TO ADD 10 TO AGE ↓ ✅
age = age + 10
print("Your age is: "+str(age))
2 changes: 1 addition & 1 deletion exercises/05-User-Inputed-Values/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ def test_plus_ten(stdin):
sys.stdout = buffer = io.StringIO()
import app
captured = buffer.getvalue()
assert captured == "Your age is: 60\n"
assert "Your age is: 60\n" in captured

18 changes: 12 additions & 6 deletions exercises/06-String-Concatenation/README.es.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
# `06` String Concatenation

Una de las tareas más comunes que tú tendrás que realizar con cualquier lenguaje incluye el unir o combinar strings.
La concatenación de strings es una tarea común en la programación que implica combinar o unir dos o más strings.

A esto le llamamos: **concatenar**.
Puedes pensar en este proceso como conectar dos o más vagones de tren. Si cada string es un vagón, la concatenación es el acoplamiento que los une para formar un tren único.

La mejor forma de explicarlo es cuando tienes dos *strings* separados – almacenados por el intérprete – y tienes que unirlos de forma que sean uno solo.
En Python, puedes concatenar o unir dos o más strings usando el operador `+`. Así es como funciona:

```py

one = 'a'
two = 'b'
print(one+two); # esto imprimirá 'ab' en la consola.
print(one + two) # esto imprimirá 'ab' en la consola.
```

## 📝 Instrucciones:
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.

## 📝 Instrucciones:
1. Establece los valores para `my_var1` y `my_var2` de manera que, al concatenarlos, el código imprima `Hello World` en la consola.


1. Establece valores para las variables `my_var1` y `my_var2` de forma que el código imprima `Hello World` en la consola.
## 💡 Pista:
+ 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)
17 changes: 11 additions & 6 deletions exercises/06-String-Concatenation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,23 @@ tutorial: "https://www.youtube.com/watch?v=kS4qpQmHwCs"

# `06` String Concatenation

One common task you’ll need to accomplish with any language involves merging or combining strings.
String concatenation is a common task in programming that involves combining or linking two or more strings together.

This process is referred to as: **concatenation**.
You can think of this process as similar to connecting two or more train cars. If each string is a train car, concatenation is the coupling that joins them to form a single train.

The best way to describe it is when you take two separate strings – stored by the interpreter – and merge them so that they become one.
In Python, you can concatenate, or join together, two or more strings using the `+` operator. This is how it works:

```py

one = 'a'
two = 'b'
print(one+two); #this will print 'ab' on the console.
print(one + two) # this will print 'ab' on the console.
```

## 📝 Instructions:
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.

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

1. Set the values for `my_var1` and `my_var2` so the code prints `Hello World` in the console.
## 💡 Hint:
+ 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)
2 changes: 1 addition & 1 deletion exercises/06-String-Concatenation/app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Set the values for my_var1 and my_var2 here
# ✅ ↓ Set the values for my_var1 and my_var2 here ↓ ✅


## Don't change below this line
Expand Down
3 changes: 2 additions & 1 deletion exercises/06-String-Concatenation/solution.hide.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Set the values for my_var1 and my_var2 here
# ✅ ↓ Set the values for my_var1 and my_var2 here ↓ ✅

my_var1 = "Hello"
my_var2 = "World"

Expand Down
6 changes: 3 additions & 3 deletions exercises/06-String-Concatenation/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ def test_my_var2_exists():
@pytest.mark.it("Variable my_var1 value should be 'Hello'")
def test_my_var1_value():
from app import my_var1
assert my_var1 == "Hello"
assert my_var1.lower() == "hello"

@pytest.mark.it("Variable my_var2 value should be 'World'")
def test_my_var2_value():
from app import my_var2
assert my_var2 == "World"
assert my_var2.lower() == "world"

@pytest.mark.it("Variable my_var2 value should be 'World'")
def test_the_new_string_exists():
Expand All @@ -38,4 +38,4 @@ def test_the_new_string_exists():
@pytest.mark.it('Print "Hello World" on the console')
def test_for_file_output():
captured = buffer.getvalue()
assert captured == "Hello World\n" #add \n because the console jumps the line on every print
assert "hello world\n" in captured.lower() #add \n because the console jumps the line on every print
5 changes: 3 additions & 2 deletions exercises/07-Create-a-Basic-HTML/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
g = '<title>'
h = '<body>'

# ⬆ DON'T CHANGE THE CODE ABOVE ⬆
# ↓ start coding below here ↓
# ❌ ⬆ DON'T CHANGE THE CODE ABOVE ⬆ ❌

# ✅ ↓ start coding below here ↓ ✅

5 changes: 3 additions & 2 deletions exercises/07-Create-a-Basic-HTML/solution.hide.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
g = '<title>'
h = '<body>'

# ⬆ DON'T CHANGE THE CODE ABOVE ⬆
# ↓ start coding below here ↓
# ❌ ⬆ DON'T CHANGE THE CODE ABOVE ⬆ ❌

# ✅ ↓ start coding below here ↓ ✅

html_document = e+c+g+a+f+h+d+b
print(html_document)
4 changes: 2 additions & 2 deletions exercises/07-Create-a-Basic-HTML/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def test_html_document_exists():
def test_html_document_exists():
try:
from app import html_document
assert html_document == '<html><head><title></title></head><body></body></html>'
assert html_document == '<html><head><title></title></head><body></body></html>'
except ImportError:
raise ImportError("The variable 'html_document' should exist on app.py")

Expand All @@ -30,4 +30,4 @@ def test_for_concat():
@pytest.mark.it('Print a basic html layout on the console like this: <html><head><title></title></head><body></body></html>')
def test_for_file_output():
captured = buffer.getvalue()
assert captured == "<html><head><title></title></head><body></body></html>\n" #add \n because the console jumps the line on every print
assert "<html><head><title></title></head><body></body></html>\n" in captured #add \n because the console jumps the line on every print
11 changes: 11 additions & 0 deletions exercises/08.1-Your-First-If/README.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,14 @@ La aplicación actual está preguntando cuánto dinero tiene el usuario. Una vez
+ Usa un condicional `if/else` para verificar el valor de la variable `total`.

+ Puedes leer más al respecto [aquí](https://docs.python.org/3/tutorial/controlflow.html#if-statements).

+ Aquí tienes un recordatorio sobre los operadores relacionales:

| Operador | Descripción | Sintaxis |
|----------|------------------------------------------------------------------------------|----------|
| > | Mayor que: Verdadero si el operando izquierdo es mayor que el derecho | x > y |
| < | Menor que: Verdadero si el operando izquierdo es menor que el derecho | x < y |
| == | Igual a: Verdadero si ambos operandos son iguales | x == y |
| != | No igual a – Verdadero si los operandos no son iguales | x != y |
| >= | Mayor o igual que: Verdadero si el operando izquierdo es mayor o igual | x >= y |
| <= | Menor o igual que: Verdadero si el operando izquierdo es menor o igual | x <= y |
13 changes: 12 additions & 1 deletion exercises/08.1-Your-First-If/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ tutorial: "https://www.youtube.com/watch?v=x9wqa5WQZiM"

# `08.1` Your First if...

The current application is prompting asking how much money the user has. Once the user inputs the amount, we need to **print** one of the following answers:
The current application is asking how much money the user has. Once the user inputs the amount, we need to **print** one of the following answers:

## 📝 Instructions:

Expand All @@ -19,3 +19,14 @@ The current application is prompting asking how much money the user has. Once th
+ Use an If/else statement to check the value of the `total` variable.

+ Further information [here](https://docs.python.org/3/tutorial/controlflow.html#if-statements).

+ Here's a quick reminder on relational operators:

| Operator | Description | Syntax |
|----------|--------------------------------------------------------------------|-----------|
| > | Greater than: True if the left operand is greater than the right | x > y |
| < | Less than: True if the left operand is less than the right | x < y |
| == | Equal to: True if both operands are equal | x == y |
| != | Not equal to – True if operands are not equal | x != y |
| >= | Greater than or equal to: True if left operand is greater or equal | x >= y |
| <= | Less than or equal to: True if left operand is less than or equal | x <= y |
2 changes: 1 addition & 1 deletion exercises/08.1-Your-First-If/app.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
total = int(input('How much money do you have in your pocket\n'))

# YOUR CODE HERE
# ✅ ↓ YOUR CODE HERE ↓ ✅
Loading