uaveiro-leci/1ano/1semestre/fp/aula03/ex10_11.md

13 lines
323 B
Markdown
Executable File

#### Exercícios propostos no [CodeCheck](https://horstmann.com/codecheck/index.html)
___
## Ex 10.
def hms2sec(h, m, s):<br />
&emsp;sec = h * 3600 + m * 60 + s
&emsp;return sec
___
## Ex 11.
def sec2hms(sec):<br />
&emsp;h = sec // 3600<br />
&emsp;m = (sec // 60) % 60<br />
&emsp;s = sec % 60<br />
&emsp;return h, m, s