Skip to content

Commit 7a4b90d

Browse files
committed
08-hours_and_minutes
1 parent a74ba7f commit 7a4b90d

File tree

3 files changed

+17
-22
lines changed

3 files changed

+17
-22
lines changed

exercises/08-hours_and_minutes/README.es.md

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,24 @@
11
# `08` Horas y minutos
22

3-
La siguiente función nos dirá la hora pasada la medianoche, es decir, suponiendo que es medianoche la función va a recibir por parámetro la cantidad de segundos que han pasado y esto resultará en una hora estimada.
3+
En este ejercicio vamos a suponer que es medianoche, queremos que con la función `hours_minutes` que hemos provisto para tí nos digas cuánto tiempo han pasado desde entonces con los segundos que se introduzcan como parámetro.
4+
45
## 📝 Instrucciones:
56

67
1. Completa la función para que retorne el resultado esperado.
78

89
2. Realiza dos calculos con los segundos que se pasan por parámetro en la función para que uno calcule la hora segun segundos que han pasado y el otro para saber los minutos `(hora , minutos)`
910

10-
11-
[comment]: <Dado el número entero `N` - el número de segundos que pasan desde la medianoche:
12-
13-
1. ¿cuántas horas y minutos completos han pasado desde la medianoche?
14-
15-
El programa debe imprimir dos números: el número de horas (entre 0 y 23) y el número de minutos (entre 0 y 1339).
16-
17-
Por ejemplo:
18-
19-
* Si N = 3900 han pasado 3900 segundos desde la medianoche ,es decir, ahora es la 1:05 am.
20-
21-
El programa debe imprimir 1 65 1 hora completa ha pasado desde la medianoche, 65 minutos completos han pasado desde la medianoche.>
22-
23-
2411
## Ejemplo de entrada:
2512
```py
26-
3900
13+
3900 # 1
14+
15+
60 # 2
2716
```
2817
## Ejemplo de salida:
2918
```py
30-
(2, 5)
19+
(2, 5) # 1
20+
21+
(0, 1) # 2
3122
```
3223
## 💡 Pista:
3324

exercises/08-hours_and_minutes/README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
# `08` Hours and Minutes
22

3-
The following function will tell us the time after midnight, that is, assuming that it is midnight the function will receive by parameter the number of seconds that have passed and this will result in an estimated time.
3+
In this exercise we are going to suppose that it is midnight, we want that with the function `hours_minutes` that we have provided for you tell us how much time has passed since then with the seconds that are introduced as parameter.
44

55
## 📝 Instructions:
66

77
1. Complete the function to return the expected result.
88

9-
2. Performs two calculations with the seconds that are passed by parameter in the function so that one calculates the time according to the seconds that have passed and the other to know the minutes `(hour , minutes)`.
9+
2. Perform two calculations with the seconds that are passed by parameter in the function so that one calculates the time according to the seconds that have passed and the other to know the minutes `(hour , minutes)`.
1010

1111
## Example input:
1212
```py
13-
3900
13+
3900 # 1
14+
15+
60 # 2
1416
```
1517

1618
## Example output:
1719
```py
18-
(2, 5)
20+
(2, 5) # 1
21+
22+
(0, 1) # 2
1923
```
2024
## 💡 Hint:
2125

exercises/08-hours_and_minutes/solution.hide.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
def hours_minutes(secs):
33
hours = secs // 3600
44
mins = secs // 60
5-
while (mins >= 60):
5+
while (mins > 59):
66
hours += 1
77
mins -= 60
88

0 commit comments

Comments
 (0)