File tree Expand file tree Collapse file tree 3 files changed +4
-14
lines changed
exercises/08-hours_and_minutes Expand file tree Collapse file tree 3 files changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -3,8 +3,5 @@ def hours_minutes(secs):
33
44 return None
55
6-
7-
8-
96#Invoke the funtion and pass any interger as its argument.
107print (hours_minutes (3900 ))
Original file line number Diff line number Diff line change 1- #Complete the function to calculate how many hours and minutes are passed since midnight.
21def hours_minutes (secs ):
3- hours = secs // 3600
42 mins = secs // 60
5- while (mins > 59 ):
6- hours += 1
7- mins -= 60
8-
9-
10- return (hours , mins )
3+ return (secs // 3600 , mins % 60 )
Original file line number Diff line number Diff line change @@ -10,17 +10,17 @@ def test_for_file_output(capsys, app):
1010
1111@pytest .mark .it ('The function hours_minutes must return the correct output for 3900 secs' )
1212def test_for_file_output (capsys , app ):
13- assert app .hours_minutes (3900 ) == (2 , 5 )
13+ assert app .hours_minutes (3900 ) == (1 , 5 )
1414
1515
1616@pytest .mark .it ('The function hours_minutes must return the correct output for 4004 secs' )
1717def test_for_file_output (capsys , app ):
18- assert app .hours_minutes (4004 ) == (2 , 6 )
18+ assert app .hours_minutes (4500 ) == (1 , 15 )
1919
2020
2121@pytest .mark .it ('The function hours_minutes must return the correct output for 60 secs' )
2222def test_for_file_output (capsys , app ):
23- assert app .hours_minutes (7320 ) == (4 , 2 )
23+ assert app .hours_minutes (7320 ) == (2 , 2 )
2424
2525
2626
You can’t perform that action at this time.
0 commit comments