Login and get coding
In this Bite we will look at this short server log, finding the first and last system shutdown events:INFO 2014-07-03T23:27:51 supybot Shutdown initiated.
INFO 2014-07-03T23:31:22 supybot Shutdown initiated.
You'll need to calculate the time between these two events. First extract the timestamps from the log entries and convert them to
datetimeobjects. Then use
datetime.timedeltato calculate the time difference between them.
You can assume the log is sorted in ascending order. Check out each function's
docstringand the TESTS for more details on how to solve this Bite.
Good luck, keep calm, and code in Python!
1302 out of 1523 users completed this Bite.
Will you be Pythonista #1303 to crack this Bite?
Resolution time: ~69 min. (avg. submissions of 5-240 min.)
Pythonistas rate this Bite 5.72 on a 1-10 difficulty scale.
» Up for a challenge? 💪