Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion exercises/11-Create-A-New-Function/README.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ r1 = random.randint(0, 10)
print("Random number between 0 and 10 is % s" % (r1))
```

Puedes usar la función `randint()` para obtener un número decimal aleatorio. Esta es una función incorporada del **módulo random** en Python3.
Puedes usar la función `randint()` para obtener un número entero aleatorio. Esta es una función incorporada del **módulo random** en Python3.

El **módulo random** te da acceso a varias funciones útiles y una de ellas es, `randint()`, capaz de generar números aleatorios.

Expand Down
4 changes: 2 additions & 2 deletions exercises/11-Create-A-New-Function/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ r1 = random.randint(0, 10)
print("Random number between 0 and 10 is % s" % (r1))
```

You can use the `randint()` function to get a random decimal number. `Randint()` is an inbuilt function of the **random module** in Python3.
You can use the `randint()` function to get a random integer number. `randint()` is a built-in function from the **random module** in Python.

The **random module** gives access to various useful functions and one of them being able to generate random numbers, which is `randint()`.

## 📝 Instructions:

1. Please now create a function called `generate_random` that prints and returns a random number between 0 and 9 every time it is called.
1. Now please create your own function called `generate_random` that prints and returns a random number between 0 and 9 every time it is called.

## 💡 Hints:

Expand Down
5 changes: 4 additions & 1 deletion exercises/11-Create-A-New-Function/solution.hide.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
# your code here
def generate_random():
result = random.randint(0,9)
return result
print(result)
return result

generate_random()