w3resource

Python: Get the first and last second

Python Datetime: Exercise-52 with Solution

Write a Python program to get the first and last second.

Sample Solution:

Python Code:

import datetime
print("First Second: ", datetime.time.min)
print("Last Second: ", datetime.time.max)

Sample Output:

First Second:  00:00:00                                                                                       
Last Second:  23:59:59.999999 

Flowchart:

Flowchart: Get the first and last second.

Python Code Editor:

Contribute your code and comments through Disqus.

Previous: Write a Python program to generate RFC 3339 timestamp.
Next: Write a Python program to validate a Gregorian date. The month is between 1 and 12 inclusive, the day is within the allowed number of days for the given month. Leap year’s are taken into consideration. The year is between 1 and 32767 inclusive.

What is the difficulty level of this exercise?

Test your Programming skills with w3resource's quiz.



Follow us on Facebook and Twitter for latest update.