Skip to content

Commit d8777d7

Browse files
authored
Merge pull request #53 from josemoracard/jose3-sum-of-three-numbers
exercises 003-sum_of_three_numbers to 008-two_timestamps
2 parents 8536057 + 59558da commit d8777d7

File tree

36 files changed

+171
-202
lines changed

36 files changed

+171
-202
lines changed

exercises/001-hello_world/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
# your code here
1+
# Your code here
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Your code here
2+
print("Hello World")

exercises/002-sum_of_three_numbers/README.es.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
1. Teniendo tres números de entrada, imprime su suma. Cada número va en una línea aparte.
66

7-
## Ejemplo de entrada:
7+
## 📎 Ejemplo de entrada:
88

99
```py
1010
2
1111
3
1212
6
1313
```
1414

15-
## Ejemplo de salida:
15+
## 📎 Ejemplo de salida:
1616

1717
```py
1818
11

exercises/002-sum_of_three_numbers/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
1. Taking 3 numbers from the input, print their sum. Every number is given on a separate line.
66

7-
## Example input:
7+
## 📎 Example input:
88

99
```py
1010
2
1111
3
1212
6
1313
```
1414

15-
## Example output:
15+
## 📎 Example output:
1616

1717
```py
1818
11
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Sum all three input numbers and print on the console the result
2-
first_number = int(input("First input"))
3-
second_number = int(input("Second input"))
4-
third_number = int(input("Third input"))
5-
# print here the sum of three inputs
2+
first_number = int(input("First input: "))
3+
second_number = int(input("Second input: "))
4+
third_number = int(input("Third input: "))
65

7-
print(first_number+second_number)
6+
7+
# Print here the sum of all three inputs
8+
print(first_number+second_number)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Sum all three input numbers and print on the console the result
2+
first_number = int(input("First input: "))
3+
second_number = int(input("Second input: "))
4+
third_number = int(input("Third input: "))
5+
6+
7+
# Print here the sum of all three inputs
8+
print(first_number+second_number+third_number)

exercises/003-area_of_right_triangle/README.es.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@
22

33
## 📝 Instrucciones:
44

5-
1. Completa la función `area_of_triangle()` para que que tome el largo de la base y la altura de un triángulo rectángulo e imprima su área. Cada número es dado en una línea por separado.
5+
1. Completa la función `area_of_triangle()` para que tome el largo de la base y la altura de un triángulo rectángulo e imprima su área.
66

7-
![Imagen descriptiva](http://i.imgur.com/6EkzVxA.jpg)
7+
![triángulo rectángulo fórmula del área](http://i.imgur.com/6EkzVxA.jpg)
88

9-
## Ejemplo:
9+
## 📎 Ejemplo:
1010

1111
```py
1212
area_of_triangle(3,5)
13-
print(7.5)
13+
# Salida --> 7.5
1414
```
15+
1516
## 💡 Pistas:
1617

1718
+ Si no sabes por donde empezar este ejercicio, por favor, revisa la teoría en esta lección: https://snakify.org/lessons/print_input_numbers/
1819

19-
+ También puedes intentar paso a paso con trozos de la teoría: https://snakify.org/lessons/print_input_numbers/steps/1/
20+
+ También puedes intentar paso a paso con trozos de la teoría: https://snakify.org/lessons/print_input_numbers/steps/1/

exercises/003-area_of_right_triangle/README.md

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

33
## 📝 Instructions:
44

5-
1. Complete the `area_of_triangle()` function so that it reads the length of the base and the height of a right-angled triangle and prints the area. Every number is given on a separate line.
5+
1. Complete the `area_of_triangle()` function so that it reads the length of the base and the height of a right-angled triangle and prints the area.
66

7-
![Image description](http://i.imgur.com/6EkzVxA.jpg)
7+
![right triangle area formula](http://i.imgur.com/6EkzVxA.jpg)
88

9-
## Ejemplo:
9+
## 📎 Example:
1010

1111
```py
1212
area_of_triangle(3,5)
13-
print(7.5)
13+
# Output --> 7.5
1414
```
1515
## 💡 Hints:
1616

17-
+ If you don't know how to start solving this exercise, please, review a theory for this lesson: https://snakify.org/lessons/print_input_numbers/
17+
+ If you don't know how to start solving this exercise, please review the theory for this lesson: https://snakify.org/lessons/print_input_numbers/
1818

19-
+ You may also try step-by-step theory chunks: https://snakify.org/lessons/print_input_numbers/steps/1/
19+
+ You may also try step-by-step theory chunks: https://snakify.org/lessons/print_input_numbers/steps/1/

exercises/003-area_of_right_triangle/app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Complete the function to return the area of the triangle.
2-
def area_of_triangle(arg1, arg2):
3-
#your code here, please remove the "None"
1+
# Complete the function to return the area of a triangle
2+
def area_of_triangle(base, height):
3+
# Your code here, please remove the "None"
44
return None
55

66
# Testing your function
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#Complete the function to return the area of the triangle.
2-
def area_of_triangle(arg1, arg2):
3-
#your code here, please remove the "None"
4-
return arg1 * arg2 / 2
1+
# Complete the function to return the area of a triangle
2+
def area_of_triangle(base, height):
3+
# Your code here, please remove the "None"
4+
return base * height / 2
55

66
# Testing your function
7-
print(area_of_triangle(3, 5))
7+
print(area_of_triangle(3, 5))

exercises/004-hello_harry/README.es.md

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

33
## 📝 Instrucciones:
44

5-
1. Completa la función `hello_name()` para que salude al usuario imprimiendo la palabra `Hello`, luego le agregue una coma, el nombre del usuario y un signo de exclamación después de él.
5+
1. Completa la función `hello_name()` para que salude al usuario imprimiendo la palabra `Hello`, luego le agregue una coma, el nombre del usuario y un signo de exclamación después.
66

77
*La salida de tu función debe coincidir estrictamente con la deseada, caracter por caracter. No debe haber ningún espacio entre el nombre y el signo de exclamación.*
88

9-
## Ejemplo entrada:
9+
## 📎 Ejemplo de entrada:
1010

1111
```py
1212
hello_name("Harry")
1313
```
14-
## Ejemplo de salida:
14+
## 📎 Ejemplo de salida:
1515

16+
```text
1617
Hello, Harry!
18+
```
1719

1820
## 💡 Pistas:
1921

20-
+ Puedes usar el operador '+' para concatenar dos strings de texto. Ve la lección para más detalles.
22+
+ Puedes usar el operador `+` para concatenar dos strings de texto. Repasa la lección para más detalles.
2123

22-
+ Si no sabes por donde partir este ejercicio por favor, revisa la teoría en esta lección:
23-
https://snakify.org/lessons/print_input_numbers/
24+
+ Si no sabes por donde empezar este ejercicio, por favor, revisa la teoría en esta lección: https://snakify.org/lessons/print_input_numbers/
2425

25-
+ También puedes intentar paso a paso con trozos de la teoría:
26-
https://snakify.org/lessons/print_input_numbers/steps/1/
26+
+ También puedes intentar paso a paso con trozos de la teoría: https://snakify.org/lessons/print_input_numbers/steps/1/

exercises/004-hello_harry/README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,26 @@
22

33
## 📝 Instructions:
44

5-
1. Complete the `hello_name()` function that greets the user by printing the word `Hello`, a comma, the name of the user and an exclamation mark after it.
5+
1. Complete the `hello_name()` function that greets the user by printing the word `Hello`, a comma, the name of the user, and an exclamation mark after it.
66

77
*Your function's output should strictly match the desired one, character by character. There shouldn't be any space between the name and the exclamation mark.*
88

9-
## Example input:
9+
## 📎 Example input:
1010

1111
```py
1212
hello_name("Harry")
1313
```
1414

15-
## Example output:
15+
## 📎 Example output:
1616

17+
```text
1718
Hello, Harry!
19+
```
1820

1921
## 💡 Hints:
2022

21-
+ You can use '+' operator to concatenate two strings. See the lesson for details.
23+
+ You can use `+` operator to concatenate two strings. review the lesson for details.
2224

23-
+ If you don't know how to start solving this assignment, please, review a theory for this lesson: https://snakify.org/lessons/print_input_numbers/
25+
+ If you don't know how to start solving this assignment, please review the theory for this lesson: https://snakify.org/lessons/print_input_numbers/
2426

2527
+ You may also try step-by-step theory chunks: https://snakify.org/lessons/print_input_numbers/steps/1/

exercises/004-hello_harry/app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#Complete the function below to print the output per the example.
1+
# Complete the function below to print the output as per the example
22
def hello_name(name):
3-
3+
# Your code here
44
return None
55

6-
#Invoke the function with your name as the function's argument.
6+
# Invoke the function with your name as the function's argument
77
print(hello_name("Bob"))
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#Complete the function below to print the output per the example.
1+
# Complete the function below to print the output as per the example
22
def hello_name(name):
3-
3+
# Your code here
44
return "Hello, "+name+"!"
55

6-
#Invoke the function with your name as the function's argument.
6+
# Invoke the function with your name as the function's argument
77
print(hello_name("Bob"))

exercises/005-previous_and_next/README.es.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,22 @@
44

55
1. Completa la función `previous_next()` para que lea un número entero y devuelva sus números anteriores y siguientes.
66

7-
## Ejemplo:
7+
## 📎 Ejemplo de entrada:
88

99
```py
1010
previous_next(179)
1111
```
1212

13-
## Ejemplo de salida:
13+
## 📎 Ejemplo de salida:
1414

15-
+ (178, 180)
15+
```py
16+
(178, 180)
17+
```
1618

1719
## 💡 Pistas:
1820

19-
+ Puedes devolver múltiples parámetros: return a, b
21+
+ Puedes devolver múltiples parámetros: `return a, b`
2022

2123
+ Si no sabes por donde partir este ejercicio, por favor revisa la teoría en esta lección: https://snakify.org/lessons/print_input_numbers/
2224

23-
+ También puedes intentar paso a paso con trozos de la teoría: https://snakify.org/lessons/print_input_numbers/steps/1/
25+
+ También puedes intentar paso a paso con trozos de la teoría: https://snakify.org/lessons/print_input_numbers/steps/1/

exercises/005-previous_and_next/README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,22 @@
44

55
1. Complete a function `previous_next()` that reads an integer number and returns its previous and next numbers.
66

7-
## Example input:
7+
## 📎 Example input:
88

99
```py
1010
previous_next(179)
1111
```
12-
## Example output:
1312

14-
+ (178, 180)
13+
## 📎 Example output:
14+
15+
```py
16+
(178, 180)
17+
```
1518

1619
## 💡 Hints:
1720

18-
+ You can return multiple parameters: return a, b
21+
+ You can return multiple parameters: `return a, b`
1922

2023
+ If you don't know how to start solving this assignment, please, review a theory for this lesson: https://snakify.org/lessons/print_input_numbers/
2124

22-
+ You may also try step-by-step theory chunks: https://snakify.org/lessons/print_input_numbers/steps/1/
25+
+ You may also try step-by-step theory chunks: https://snakify.org/lessons/print_input_numbers/steps/1/
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
#Complete the function to return the previous and next number of a given numner.".
1+
# Complete the function to return the previous and next number of a given number
22
def previous_next(num):
3+
# Your code here
34
return None
45

56

6-
#Invoke the function with any interger at its argument.
7-
print(previous_next(179))
7+
# Invoke the function with any integer as its argument
8+
print(previous_next(179))
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
#Complete the function to return the previous and next number of a given numner.".
1+
# Complete the function to return the previous and next number of a given number
22
def previous_next(num):
3+
# Your code here
34
return (num-1, num+1)
45

56

6-
#Invoke the function with any interger at its argument.
7-
print(previous_next(179))
7+
# Invoke the function with any integer as its argument
8+
print(previous_next(179))

exercises/005-previous_and_next/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def test_for_functon_existence(capsys, app):
88
def test_function_return(capsys, app):
99
assert app.previous_next(6) != None
1010

11-
@pytest.mark.it('The function return a tuple')
11+
@pytest.mark.it('The function should return a tuple')
1212
def test_function_return_type(capsys, app):
1313
result = app.previous_next(6)
1414
assert type(result) == type((1,2))

exercises/006-apple_sharing/README.es.md

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

33
## 📝 Instrucciones:
44

5-
1. `N` estudiantes cogen `K` manzanas y las distribuyen entre ell@s de manera uniforme. La parte restante (la indivisible) permanece en la cesta. ¿Cuántas manzanas recibirá cada estudiante? y ¿Cuántas manzanas quedarán en la cesta? *Esta función lee los números `N` y `K` y debería devolver la respuesta a ambas preguntas.*
5+
1. `N` estudiantes cogen `K` manzanas y las distribuyen entre ellos de manera uniforme. La parte restante (indivisible) permanece en la cesta. ¿Cuántas manzanas recibirá cada estudiante? y ¿Cuántas manzanas quedarán en la cesta? *Esta función lee los números `N` y `K` y debería devolver la respuesta a ambas preguntas.*
66

7-
## Ejemplo de entrada:
7+
## 📎 Ejemplo de entrada:
88

99
```py
1010
apple_sharing(6, 50)
1111
```
1212

13-
## Ejemplo de salida:
13+
## 📎 Ejemplo de salida:
1414

15-
+ (8, 2)
15+
```py
16+
(8, 2)
17+
```
1618

1719
## 💡 Pistas:
1820

19-
+ Puedes devolver múltiples parámetros: return a, b
21+
+ Puedes devolver múltiples parámetros: `return a, b`
2022

21-
+ Si no sabes por donde partir este ejercicio por favor, revisa la teoría en esta lección:
22-
https://snakify.org/lessons/print_input_numbers/
23+
+ Si no sabes por donde partir este ejercicio, por favor, revisa la teoría en esta lección: https://snakify.org/lessons/print_input_numbers/
2324

24-
+ También puedes intentar paso a paso con trozos de la teoría:
25-
https://snakify.org/lessons/print_input_numbers/steps/1/
25+
+ También puedes intentar paso a paso con trozos de la teoría: https://snakify.org/lessons/print_input_numbers/steps/1/

exercises/006-apple_sharing/README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,24 @@
22

33
## 📝 Instructions:
44

5-
1. `N` students take `K` apples and distribute them among each other evenly. The remaining (the indivisible) part remains in the basket. How many apples will each single student get and how many apples will remain in the basket? *The function reads the numbers `N` and `K` and it should return the two answers for the questions above.*
5+
1. `N` students take `K` apples and distribute them among each other evenly. The remaining (indivisible) part remains in the basket. How many apples will each single student get, and how many apples will remain in the basket? *The function reads the numbers `N` and `K` and it should return the two answers for the questions above.*
66

7-
## Example input:
7+
## 📎 Example input:
88

99
```py
1010
apple_sharing(6, 50)
1111
```
1212

13-
## Example output:
14-
15-
+ (8, 2)
13+
## 📎 Example output:
1614

15+
```py
16+
(8, 2)
17+
```
1718

1819
## 💡 Hints:
1920

20-
+ You can return multiple parameters: return a, b
21+
+ You can return multiple parameters: `return a, b`
2122

22-
+ If you don't know how to start solving this assignment, please, review a theory for this lesson:
23-
https://snakify.org/lessons/print_input_numbers/
23+
+ If you don't know how to start solving this assignment, please review the theory for this lesson: https://snakify.org/lessons/print_input_numbers/
2424

25-
+ You may also try step-by-step theory chunks:
26-
https://snakify.org/lessons/print_input_numbers/steps/1/
25+
+ You may also try step-by-step theory chunks: https://snakify.org/lessons/print_input_numbers/steps/1/

0 commit comments

Comments
 (0)