Skip to content

Change the documantation link #48

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

Closed
wants to merge 211 commits into from
Closed
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
211 commits
Select commit Hold shift + click to select a range
f0ac639
Update README.md
hexbreak Feb 7, 2021
c5f9a89
Update README.md
hexbreak Feb 8, 2021
c90e3d6
Update README.md
hexbreak Feb 8, 2021
d8f1327
Merge pull request #11 from hexbreak/patch-3
alesanchezr Feb 8, 2021
03d3cad
Merge pull request #10 from hexbreak/patch-2
alesanchezr Feb 8, 2021
e12fad0
Merge pull request #9 from hexbreak/patch-1
alesanchezr Feb 8, 2021
503453a
Update README.md
hexbreak Feb 8, 2021
59d2593
Merge pull request #12 from hexbreak/patch-4
alesanchezr Feb 8, 2021
c770ba6
badge uploaded
ElviraQDP Mar 13, 2021
38a2a4c
Update learn.json
tommygonzaleza Jul 23, 2021
f060763
Update .gitpod.yml
tommygonzaleza Jul 23, 2021
c9b5807
Update .gitpod.Dockerfile
tommygonzaleza Jul 23, 2021
aefa296
errores de tipeo
wotanCode Jul 24, 2021
7d69489
error de tipeo
wotanCode Jul 24, 2021
be715d3
Error en el código de ejemplo
wotanCode Jul 24, 2021
fcfd3c4
Se eliminan líneas innecesarias
wotanCode Jul 25, 2021
3a33a03
Update .gitpod.Dockerfile
tommygonzaleza Jul 30, 2021
2b9827e
Merge pull request #19 from tommygonzaleza/master
alesanchezr Aug 3, 2021
c17c72f
Merge pull request #14 from learnpack/master
alesanchezr Aug 3, 2021
d8a5d6a
Merge pull request #15 from wotanCode/patch-1
alesanchezr Aug 3, 2021
2ac38ff
Merge pull request #16 from wotanCode/patch-2
alesanchezr Aug 3, 2021
61a39ab
Merge pull request #18 from wotanCode/patch-4
alesanchezr Aug 3, 2021
5eac136
Merge pull request #17 from wotanCode/patch-3
alesanchezr Aug 3, 2021
35689ae
Update .gitpod.Dockerfile
alesanchezr Aug 5, 2021
bfcb529
Update learn.json
alesanchezr Aug 5, 2021
4411587
finish reviewing instructions
ElviraQDP Aug 11, 2021
344f259
Update tests.py
alesanchezr Oct 4, 2021
0bdffed
learnpack audit's action added to the repository
tommygonzaleza Oct 9, 2021
fd83574
Merge pull request #21 from tommygonzaleza/master
alesanchezr Oct 21, 2021
b83fcc6
Editor version updated
tommygonzaleza Oct 28, 2021
3b6aa7d
Learnpack clean fixed by updating learnpack
tommygonzaleza Oct 31, 2021
7977e3a
Merge pull request #22 from tommygonzaleza/editor-version
alesanchezr Nov 3, 2021
927ddd0
Update .gitpod.Dockerfile
tommygonzaleza Nov 3, 2021
f146094
Merge pull request #23 from tommygonzaleza/learnpack-version
alesanchezr Nov 15, 2021
05ef8e3
Update README.es.md
tommygonzaleza Dec 6, 2021
5c3914c
Update README.es.md
tommygonzaleza Dec 6, 2021
57ec31e
Update README.es.md
tommygonzaleza Dec 6, 2021
6f4e342
Update README.es.md
tommygonzaleza Dec 6, 2021
4aa1c77
Update README.md
tommygonzaleza Dec 6, 2021
74248b2
Merge pull request #20 from ElviraQDP/master
tommygonzaleza Dec 6, 2021
d443683
coding ide version changed to 1.0.72
tommygonzaleza Dec 23, 2021
d1c9fbd
Merge pull request #24 from tommygonzaleza/coding-ide-version
alesanchezr Jan 13, 2022
8c81706
https://github.com/learnpack/learnpack/issues/512
ElviraQDP Jan 14, 2022
dbea562
Update README.md
tommygonzaleza Jan 20, 2022
04dbe7e
learnpack clean
ElviraQDP Jan 21, 2022
97aafc1
Merge pull request #26 from ElviraQDP/ex6
tommygonzaleza Jan 24, 2022
652a4bb
Update learn.json
tommygonzaleza Jan 24, 2022
8df11c7
04-Call-a-function
kiddopro Feb 9, 2022
d7af871
Merge pull request #27 from kiddopro/04-Call-a-function
tommygonzaleza Feb 21, 2022
ae4b874
https://github.com/learnpack/learnpack/issues/811
ElviraQDP Mar 29, 2022
c4acb50
misspell
ElviraQDP Mar 29, 2022
3e0b05a
missing content
ElviraQDP Mar 29, 2022
1c2549e
badge added
ElviraQDP Mar 30, 2022
a54cb3d
badge
ElviraQDP Mar 30, 2022
1c077c5
badge uploaded
ElviraQDP Mar 30, 2022
fe87698
Merge pull request #28 from ElviraQDP/readme.es-
tommygonzaleza Mar 31, 2022
5b6f91a
the main README´s were changed
Lorenagubaira Apr 22, 2022
6fbb75b
Update README.md
alesanchezr Apr 25, 2022
223b1bb
Update README.es.md
alesanchezr Apr 25, 2022
023c617
Update README.es.md
alesanchezr Apr 25, 2022
e19bf0c
Update README.md
alesanchezr Apr 26, 2022
7463d4b
Merge branch 'master' into main.readme.python
tommygonzaleza May 2, 2022
69af042
Update README.es.md
tommygonzaleza May 2, 2022
bbc32dc
Update README.es.md
tommygonzaleza May 2, 2022
c914a7b
Merge pull request #29 from Lorenagubaira/main.readme.python
tommygonzaleza May 2, 2022
ac13344
changed ide version
Sadiel0 May 25, 2022
c943a6b
Merge pull request #30 from Sadiel0/ide-version
tommygonzaleza May 25, 2022
cf32917
@learnpack/learnpack
Sadiel0 May 27, 2022
71d13bb
Merge pull request #31 from Sadiel0/practice-functions
tommygonzaleza May 31, 2022
f9be189
changed yml file
Sadiel0 Jun 17, 2022
1eba37a
Merge pull request #32 from Sadiel0/python-functions
tommygonzaleza Jun 20, 2022
33169cb
added \s to test to pass when space is added
Sadiel0 Jun 30, 2022
55e51a2
fixed test so it would read print on any line
Sadiel0 Jun 30, 2022
e93d16f
Merge pull request #35 from Sadiel0/hello-word
tommygonzaleza Jun 30, 2022
5b3db32
regex changed to allow many spaces
Sadiel0 Jul 5, 2022
08156f8
Update tests.py
tommygonzaleza Jul 26, 2022
6b9ec76
Merge pull request #34 from Sadiel0/array-methods
tommygonzaleza Jul 26, 2022
63bac30
test
dsilva06 Jul 27, 2022
5ce2687
Test improved on exercise 05
tommygonzaleza Jul 29, 2022
afa6454
Merge pull request #36 from dsilva06/05-Defining-vs-Calling-a-function
tommygonzaleza Jul 29, 2022
e415cf6
Update README.md
Chadmichaelg Aug 18, 2022
5d58b1f
learnpack -v
dsilva06 Aug 19, 2022
4553793
Update .gitpod.Dockerfile
tommygonzaleza Aug 22, 2022
800e1dd
Merge pull request #38 from dsilva06/learnpack-version
tommygonzaleza Aug 22, 2022
ed26fb6
Update .gitpod.Dockerfile
tommygonzaleza Aug 23, 2022
3b849b1
“learnpack”
dsilva06 Aug 27, 2022
47e0606
Merge pull request #39 from dsilva06/learnpack-version
tommygonzaleza Aug 31, 2022
ebe1894
Update learn.json
kiddopro Oct 8, 2022
c6e3b0f
camelCase
kiddopro Oct 12, 2022
486b0a3
Merge pull request #40 from kiddopro/properties
tommygonzaleza Oct 24, 2022
abf5213
Update learn.json
kiddopro Nov 6, 2022
fbc63ce
added solution
UmiKami Feb 16, 2023
6554470
Merge pull request #42 from UmiKami/07-lambda-function-two
tommygonzaleza Feb 16, 2023
f6f360e
Update learn.json
tommygonzaleza Feb 17, 2023
161612a
Update README.md
alesanchezr Mar 13, 2023
982566c
Update README.es.md
alesanchezr Mar 13, 2023
d4d9605
Update README.es.md
alesanchezr Mar 13, 2023
4605639
the footnotes were added
Lorenagubaira Apr 4, 2023
d09a84c
added sol
UmiKami Apr 6, 2023
61a33d7
Merge pull request #41 from kiddopro/properties
alesanchezr Apr 7, 2023
5b00b30
Merge pull request #44 from UmiKami/09-Function-parameters
alesanchezr Apr 7, 2023
092059b
Merge pull request #37 from Chadmichaelg/patch-1
alesanchezr Apr 7, 2023
cbcffc8
Merge pull request #43 from Lorenagubaira/python-functions-programmin…
alesanchezr Apr 7, 2023
07512a0
codepaces reference
Lorenagubaira Apr 13, 2023
61a98b6
Update .gitpod.Dockerfile
alesanchezr Apr 15, 2023
f5f0a1d
Update .gitignore
alesanchezr Apr 15, 2023
455bfcb
Create devcontainer.json
alesanchezr Apr 15, 2023
22595b4
Merge branch '4GeeksAcademy:master' into python-functions-programming…
Lorenagubaira Apr 20, 2023
d53186f
the links were updated
Lorenagubaira Apr 20, 2023
ade2590
the settings.json file was updated
Lorenagubaira Apr 24, 2023
c3efbe0
Merge pull request #46 from Lorenagubaira/python-functions.set.json
alesanchezr Apr 28, 2023
c2adf7b
Merge pull request #45 from Lorenagubaira/python-functions-programmin…
alesanchezr May 1, 2023
c1680de
increased flexibility of test by adding blank space tolerance
UmiKami Aug 30, 2023
2621f89
added solution file
UmiKami Aug 30, 2023
46963a8
Merge pull request #50 from UmiKami/04-Call-a-function
alesanchezr Sep 7, 2023
fe80228
Update README.md
josemoracard Nov 22, 2023
b27c19a
Update README.es.md
josemoracard Nov 22, 2023
25aa0c7
Update README.es.md
josemoracard Nov 22, 2023
fed4e6f
Update README.md
josemoracard Nov 22, 2023
3938ca8
Update learn.json
josemoracard Nov 22, 2023
95937fe
Update README.md
josemoracard Nov 22, 2023
d4cd0b8
Update README.md
josemoracard Nov 22, 2023
86ba89b
Update README.es.md
josemoracard Nov 22, 2023
185c68c
Update README.md
josemoracard Nov 22, 2023
849627e
Update README.md
josemoracard Nov 22, 2023
c8d874b
Update README.es.md
josemoracard Nov 22, 2023
fc6cc2c
Update README.es.md
josemoracard Nov 22, 2023
bc3b370
Update app.py
josemoracard Nov 22, 2023
ea6a0e2
Create solution.hide.py
josemoracard Nov 22, 2023
d893571
Update solution.hide.py
josemoracard Nov 22, 2023
16d9038
Update README.md
josemoracard Nov 22, 2023
1a1fec3
Update README.md
josemoracard Nov 22, 2023
3d4a114
Update README.es.md
josemoracard Nov 22, 2023
1684f58
Create solution.hide.py
josemoracard Nov 22, 2023
6040cfd
Update app.py
josemoracard Nov 22, 2023
c0891c6
Update README.md
josemoracard Nov 22, 2023
c822158
Update README.md
josemoracard Nov 22, 2023
42fffee
Update README.md
josemoracard Nov 22, 2023
2da7f65
Update README.md
josemoracard Nov 22, 2023
772e9e5
Update README.es.md
josemoracard Nov 22, 2023
0b953a0
Update app.py
josemoracard Nov 22, 2023
9a62da1
Update solution.hide.py
josemoracard Nov 22, 2023
bc85b65
Update tests.py
josemoracard Nov 22, 2023
221f1d2
Update README.md
josemoracard Nov 22, 2023
ddff8b1
Update README.md
josemoracard Nov 22, 2023
1ab3115
Update README.md
josemoracard Nov 22, 2023
6310ba4
Update README.es.md
josemoracard Nov 22, 2023
7e81a0a
Update app.py
josemoracard Nov 22, 2023
473ab8f
Update solution.hide.py
josemoracard Nov 22, 2023
8bfb202
Update tests.py
josemoracard Nov 22, 2023
e20ebf2
Added intro video
tommygonzaleza Nov 28, 2023
b3fbd36
Update README.es.md
josemoracard Nov 29, 2023
a96cd35
Update README.es.md
josemoracard Nov 29, 2023
117bc32
Update README.md
josemoracard Nov 29, 2023
b8b422f
Update README.md
josemoracard Nov 29, 2023
e1d8fe2
Update README.es.md
josemoracard Nov 29, 2023
4ed8919
Update README.md
josemoracard Nov 29, 2023
d006197
Update app.py
josemoracard Nov 29, 2023
e158501
Update tests.py
josemoracard Nov 29, 2023
f7e459f
Update tests.py
josemoracard Nov 29, 2023
0d2ba13
Update tests.py
josemoracard Nov 29, 2023
0de3fbf
Create solution.hide.py
josemoracard Nov 29, 2023
7877337
Update README.md
josemoracard Nov 29, 2023
7c657c2
Update README.md
josemoracard Nov 29, 2023
7f5cc84
Update README.es.md
josemoracard Nov 29, 2023
a18d892
Update app.py
josemoracard Nov 29, 2023
0280a20
Update solution.hide.py
josemoracard Nov 29, 2023
daa03e4
Update tests.py
josemoracard Nov 29, 2023
44a898b
Update README.md
josemoracard Nov 29, 2023
930f773
Update README.md
josemoracard Nov 29, 2023
08490fe
Update README.es.md
josemoracard Nov 29, 2023
eaefd88
Update app.py
josemoracard Nov 29, 2023
50e2eec
Update test.py
josemoracard Nov 29, 2023
114310e
Create solution.hide.py
josemoracard Nov 29, 2023
989a756
Update README.md
josemoracard Nov 29, 2023
cecf0db
Update README.es.md
josemoracard Nov 29, 2023
71fe9b0
Update solution.hide.py
josemoracard Nov 29, 2023
af4d5fd
Update README.es.md
josemoracard Nov 29, 2023
91c9d46
Update README.md
josemoracard Nov 29, 2023
a5eafd9
Update README.md
josemoracard Nov 29, 2023
3f6d997
Update README.md
josemoracard Nov 29, 2023
8bfd0bc
Update README.es.md
josemoracard Nov 29, 2023
4b35a98
Update solution.hide.py
josemoracard Nov 29, 2023
3c02856
Update app.py
josemoracard Nov 29, 2023
a229f30
Update README.md
josemoracard Nov 29, 2023
355a13a
Update tests.py
josemoracard Nov 29, 2023
b681c43
Update README.md
josemoracard Nov 29, 2023
a438081
Update README.es.md
josemoracard Nov 29, 2023
a2e3553
Merge pull request #51 from josemoracard/jose1-README
alesanchezr Dec 6, 2023
aba1fda
Merge pull request #52 from josemoracard/jose2-00-welcome
alesanchezr Dec 6, 2023
73aeec4
Merge pull request #53 from josemoracard/jose3-05-defining-vs-calling…
alesanchezr Dec 6, 2023
3f857d4
Merge pull request #54 from tommygonzaleza/patch-2
alesanchezr Dec 6, 2023
b3d24db
Merge pull request #55 from josemoracard/jose4-06-lambda-functions
alesanchezr Dec 6, 2023
30ccbe7
Update README.md
josemoracard Dec 13, 2023
ff4cc7e
Update README.md
josemoracard Dec 13, 2023
63202b9
Update README.md
josemoracard Dec 13, 2023
cc216be
Update README.es.md
josemoracard Dec 13, 2023
de8d27b
Update README.es.md
josemoracard Dec 13, 2023
ed10076
Update README.md
josemoracard Dec 13, 2023
b73c98b
Update README.es.md
josemoracard Dec 13, 2023
bb9e11d
Update README.md
josemoracard Dec 13, 2023
9084eee
Update README.md
josemoracard Dec 13, 2023
fd801fd
Update README.md
josemoracard Dec 13, 2023
e2ac839
Update README.es.md
josemoracard Dec 13, 2023
f17dff4
cambio de numeros a todo para poner el 00-welcome
josemoracard Dec 20, 2023
3b87eca
Merge pull request #56 from josemoracard/jose1-README
alesanchezr Dec 30, 2023
704c159
Merge pull request #57 from josemoracard/jose5-folders
alesanchezr Dec 30, 2023
3f0fa1e
Update devcontainer.json
Charlytoc Feb 27, 2024
5419817
Update learn.json
Charlytoc Feb 27, 2024
dfaa8ef
ADding videos
Charlytoc Mar 13, 2024
2d76d0e
Merge pull request #59 from Charlytoc/master
alesanchezr Mar 13, 2024
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
22 changes: 12 additions & 10 deletions exercises/06-lambda-functions/README.es.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,41 @@
# `06` Funciones Lambda en Python
# `06` Lambda Functions in Python

Una **función lambda** es una función con solo una línea de código y sin nombre.

Es un tipo de función muy especial en el mundo Python porque puedes usarla como una 'pequeña utilidad' para una programación muy ágil:
Es un tipo de función muy especial en el mundo Python porque puedes usarla como una pequeña utilidad para una programación muy ágil:

```python
# declarando una función normal para una multiplicación
# Declarando una función normal para una multiplicación
def multiply(p1, p2):
return p1 * p2

# declarándola en una línea como una función lambda
# Declarándola en una línea como una función lambda
multiply = lambda p1,p2: p1 * p2
```

1. Las **funciones lambda** tiene que ser siempre muy pequeñas.
### 👉 Caracteristicas:

2. Las **funciones lambda** pueden tener únicamente una línea.
+ Las **funciones lambda** tienen que ser siempre muy pequeñas.

3. Las **funciones lambda** no necesitan un `return`, se asume que lo que haya en esa línea devolverá un valor.
+ Las **funciones lambda** pueden tener únicamente una línea.

4. Las **funciones lambda** pueden almacenarse en variables o ser pasadas como parámetro a otra función.
+ Las **funciones lambda** no necesitan un `return`, se asume que lo que haya en esa línea devolverá un valor.

+ Las **funciones lambda** pueden almacenarse en variables o ser pasadas como parámetro a otra función.


## 📝 Instrucciones:

1. Crea una variable llamada `is_odd`.

2. Asígnale una función lambda que devuelva `True` o `False` dependiendo de si un número dado es impar o no.
2. Asígnale una función **lambda** que devuelva `True` o `False` dependiendo de si un número dado es impar o no.

## 💡 Pista:

+ Así es como declararías una función normal:

```python
# Esta función retorna `True` si el número es impar
# Esta función retorna "True" si el número es impar
def is_odd(num):
return (num % 2) != 0
```
23 changes: 12 additions & 11 deletions exercises/06-lambda-functions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,43 @@ tutorial: "https://www.youtube.com/watch?v=HACQ9uerCuE"
---


# `06` Lambda functions in Python
# `06` Lambda Functions in Python

A **lambda function** is a function with just one line of code and no name.

It is a very special type of funcion in the world of python because you can use it as a small utility for very agile coding:
It is a very special type of function in the world of Python because you can use it as a small utility for very agile coding:

```python
# declaring a normal funcion for multiplication
# Declaring a normal function for multiplication
def multiply(p1, p2):
return p1 * p2

# declaring it now like a one line lambda
# Declaring it now like a one line lambda function
multiply = lambda p1,p2: p1 * p2
```
:point_uo:Facts:

+ **Lambda fuctions** have to be always very small.
### 👉 Facts:

+ **Lambda function** can only have one line.
+ **Lambda functions** have to always be very small.

+ **Lambda function** doesn't need a `return` statement (it is assumed that it will return whatever is on that one line).
+ **Lambda functions** can only have one line.

+ **Lambda functions** can be stored in variables or passed as parameters to another function
+ **Lambda functions** don't need a `return` statement (it is assumed that it will return whatever is on that one line).

+ **Lambda functions** can be stored in variables or passed as parameters to another function.

## 📝 Instructions:

1. Create a variable called `is_odd`.

2. Assign a **lambda function** to it that returns `True` or `False` if a given number is odd.

## 💡Hint
## 💡 Hint

+ Here is how you would declare it like a normal function:

```py
# this function return True if a number is odd.
# This function returns True if a number is odd
def is_odd(num):
return num % 2 != 0
```
Expand Down
2 changes: 1 addition & 1 deletion exercises/06-lambda-functions/app.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# your function here
# Your function here

3 changes: 3 additions & 0 deletions exercises/06-lambda-functions/solution.hide.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Your function here

is_odd = lambda num: num % 2 != 0
6 changes: 3 additions & 3 deletions exercises/06-lambda-functions/tests.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import io, sys, pytest, os, re, mock

@pytest.mark.it("Declare a function 'is_odd' as lambda")
@pytest.mark.it("Declare a function called 'is_odd' as lambda")
def test_declare_variable():
path = os.path.dirname(os.path.abspath(__file__))+'/app.py'
with open(path, 'r') as content_file:
Expand All @@ -13,12 +13,12 @@ def test_for_callable(capsys):
import app as app
assert callable(app.is_odd)

@pytest.mark.it('The function is_odd must receive one number and return true if is odd or false otherwise')
@pytest.mark.it('The function is_odd must receive one number and return True if the number is odd or False otherwise')
def test_for_integer(capsys):
import app as app
assert app.is_odd(3) == True

@pytest.mark.it('We tested the function with 2 and the result was not False')
def test_for_integer2(capsys):
import app as app
assert app.is_odd(2) == False
assert app.is_odd(2) == False
11 changes: 5 additions & 6 deletions exercises/07-lambda-function-two/README.es.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# `07` Funciones Lambda
# `07` Lambda Functions


**:point_up: Recuerda:**
### ☝ Recuerda:

Las funciones Lambda permiten una sintaxis corta para escribir expresiones de funciones.

```python
multy = lambda x, y: x * y
print(multy(2,2))
multiply = lambda x, y: x * y
print(multiply(2,2))
```

## 📝 Instrucciones:
Expand All @@ -18,4 +17,4 @@ print(multy(2,2))

## 💡 Pista:

+ Busca en Google "remove last letter form string python" (puedes usar los corchetes).
+ Busca en Google "como eliminar el último caracter de un string python" (puedes usar los corchetes).
16 changes: 8 additions & 8 deletions exercises/07-lambda-function-two/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
tutorial: "https://www.youtube.com/watch?v=1HwmTkQPeMo"
---

# `07` Lambda functions
# `07` Lambda Functions

**:point_up: Remember:**
### ☝ Remember:

Lambda functions allows a short syntax for writing function expressions.
Lambda functions allow a short syntax for writing function expressions.

```python
multy = lambda x, y: x * y
print(multy(2,2))
multiply = lambda x, y: x * y
print(multiply(2,2))
```

## 📝 Instructions:

1. Create a lambda function called `rapid` it will take one string parameter.
1. Create a lambda function called `rapid`, which will take one string parameter.

2. Return the same string with the last letter removed.

## 💡 Hint
## 💡 Hint:

+ Google how to "remove last letter form string python" (you can use the square brackets).
+ Google "how to remove last letter from string python" (you can use the square brackets).
4 changes: 2 additions & 2 deletions exercises/07-lambda-function-two/app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@



# From this line above, plese do not change code below
print(rapid("bob")) #should print bo
# Your code above, please do not change code below
print(rapid("bob")) # Should print "bo"
5 changes: 2 additions & 3 deletions exercises/07-lambda-function-two/solution.hide.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
rapid = lambda myStr: myStr[:-1]


# From this line above, plese do not change code below
print(rapid("bob")) #should print bo
# Your code above, please do not change code below
print(rapid("bob")) # Should print "bo"
4 changes: 2 additions & 2 deletions exercises/07-lambda-function-two/tests.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import io, sys, pytest, os, re, mock

@pytest.mark.it("Declare a function 'rapid' as lambda")
@pytest.mark.it("Declare a function called 'rapid' as lambda")
def test_declare_variable():
path = os.path.dirname(os.path.abspath(__file__))+'/app.py'
with open(path, 'r') as content_file:
Expand All @@ -12,7 +12,7 @@ def test_declare_variable():
def test_for_callable(capsys):
from app import rapid

@pytest.mark.it('The function rapid must receive one string and return the same but without the last letter (make sure it\'s lowecase)')
@pytest.mark.it('The function rapid must receive one string and return the same string without the last character')
def test_for_integer(capsys):
from app import rapid
assert rapid("maria") == "mari"
Expand Down
12 changes: 7 additions & 5 deletions exercises/08-Function-that-returns/README.es.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# `08` Funciones que devuelven
# `08` Functions that return

Es una muy buena práctica que las funciones devuelvan algo, incluso si es `None`.

Si tus funciones devuelven algo, puedes crear algoritmos que usen muchas funciones al mismo tiempo. Por ejemplo, en este caso en particular tenemos dos funciones disponibles:
Si tus funciones devuelven algo, puedes crear algoritmos que usen muchas funciones al mismo tiempo.

Por ejemplo, en este caso en particular tenemos dos funciones disponibles:

+ `dollar_to_euro`: que calcula el valor en euros de un valor dado en dólares.

Expand All @@ -12,12 +14,12 @@ Si tus funciones devuelven algo, puedes crear algoritmos que usen muchas funcion

1. Utilizando las dos funciones disponibles, imprime en la consola el valor de **137** dólares en yenes.

## 💡 Pista:
## 💡 Pistas:

Trabajando al revés:
Trabajando desde el final:

- Nuestro valor esperado está en yenes.

- Nuestra función disponible `euro_to_yen` proporcionará eso.

- Para llegar al euro utilizaremos la función disponible `dollar_to_euro`.
- Para llegar al euro utilizaremos la función disponible `dollar_to_euro`.
7 changes: 3 additions & 4 deletions exercises/08-Function-that-returns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,22 @@ It is very good practice that all functions return something, even if it is `Non

With what your function returns, you can create algorithms that use multiple functions at the same time.

For example, in this particular case we have two functions available:
For example, in this particular case, we have two functions available:

+ `dollar_to_euro`: that calculates the value in euros of a given value in dollars.

+ `euro_to_yen`: calculates the value in yen of a given value in euros.


## 📝 Instructions:

1. Using the two functions available, print on the console the value of **137** dollars in yen.

## 💡 Hint
## 💡 Hints:

Working backwards:

- Our expected value is in yen.

- Our available function `euro_to_yen` will provide that.

- To get to euro we will use the available function `dollar_to_euro`.
- To get the euros, we will use the available function `dollar_to_euro`.
6 changes: 3 additions & 3 deletions exercises/08-Function-that-returns/app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
def dollar_to_euro(dollar_value):
return dollar_value * 0.89
return dollar_value * 0.91

def euro_to_yen(euro_value):
return euro_value * 124.15
return euro_value * 161.70

####### ↓ YOUR CODE BELOW ↓ #######
####### ↓ YOUR CODE BELOW ↓ #######
12 changes: 12 additions & 0 deletions exercises/08-Function-that-returns/solution.hide.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
def dollar_to_euro(dollar_value):
return dollar_value * 0.91

def euro_to_yen(euro_value):
return euro_value * 161.70

####### ↓ YOUR CODE BELOW ↓ #######

euros = dollar_to_euro(137)
yen = euro_to_yen(euros)

print(yen)
6 changes: 3 additions & 3 deletions exercises/08-Function-that-returns/test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import io, sys, pytest, os, re, mock

@pytest.mark.it("Call the function dollar_to_euro passing the 137 dollars to get the amount in Euro")
@pytest.mark.it("Call the function dollar_to_euro passing 137 dollars to get the amount in Euros")
def test_declare_variable():
path = os.path.dirname(os.path.abspath(__file__))+'/app.py'
with open(path, 'r') as content_file:
Expand All @@ -9,7 +9,7 @@ def test_declare_variable():
assert bool(regex.search(content)) == True


@pytest.mark.it("Call the function euro_to_yen passing the Euro converted amount to get the amount in Yen")
@pytest.mark.it("Call the function euro_to_yen passing the Euros converted amount to get the amount in Yen")
def test_euro_to_yen():
path = os.path.dirname(os.path.abspath(__file__))+'/app.py'
with open(path, 'r') as content_file:
Expand All @@ -22,4 +22,4 @@ def test_euro_to_yen():
def test_for_file_output(capsys):
import app
captured = capsys.readouterr()
assert "15137.609500000002\n" == captured.out
assert "20159.139\n" == captured.out
12 changes: 7 additions & 5 deletions exercises/09-Function-parameters/README.es.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `09` Parámetros de funciones
# `09` Function parameters

Puedes especificar tantos parámetros como desees en una función.

Expand All @@ -8,12 +8,14 @@ Los nombres de los parámetros no importan, pero debe ser **lo más explícito p

## 📝 Instrucciones:

+ Escribe la función `render_person` requerida para imprimir un string como el siguiente:
1. Escribe la función `render_person` requerida para imprimir un string como el siguiente:

```py
```text
Bob is a 23 years old male born in 05/22/1983 with green eyes
```

## 💡 Pista
## 💡 Pistas:

- Tienes que hacer una concatenación de string y devolver ese string.
+ Tienes que hacer una concatenación de string y devolver ese string.

+ También, puedes buscar en Google "como insertar variables en un string python".
10 changes: 6 additions & 4 deletions exercises/09-Function-parameters/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@ tutorial: "https://www.youtube.com/watch?v=uaiDxW4LJNA"

You can specify as many parameters as you want in a function.

As a developer you are going to find functions with even 6 or 7 parameters all the time.
As a developer, you are going to find functions with even 6 or 7 parameters all the time.

The names of the parameters don't matter, but you have to be **as explicit as you can** because these names will give clues to the other developers (or yourself in the future) about what is each parameter about.

## 📝 Instructions:

1. Please write the `render_person` function required to print a a string like the following:
1. Please write the `render_person` function required to print a string like the following:

```py
```text
Bob is a 23 years old male born in 05/22/1983 with green eyes
```

## 💡 Hint
## 💡 Hints:

+ You have to do some string concatenation and return that string.

+ Also, you can Google "how to insert variables into a string python".
6 changes: 3 additions & 3 deletions exercises/09-Function-parameters/solution.hide.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Your code goes here:
def render_person(name, birthdate, eye_color, age, sex):
return name +" is a "+ str(age) +" years old " + sex +" born in " + birthdate + " with "+eye_color +" eyes"
def render_person(name, birth_date, eye_color, age, gender):
return name + " is a " + str(age) + " years old " + gender + " born in " + birth_date + " with " + eye_color + " eyes"


# Do not edit below this line
print(render_person('Bob', '05/22/1983', 'green', 23, 'male'))
print(render_person('Bob', '05/22/1983', 'green', 23, 'male'))
Loading