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

13 lines
323 B
Markdown
Raw Permalink Normal View History

2022-10-11 22:31:33 +00:00
#### Exercícios propostos no [CodeCheck](https://horstmann.com/codecheck/index.html)
2022-10-11 19:27:51 +00:00
___
## 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