Answer:
Enter time 1 HH:MM:SS8:5:22
Enter time 2 HH:MM:SS7:24:37
0:40:45
Explanation:
The program for above in Python is:
from datetime import datetime
s1 = input("Enter time 1 HH:MM:SS")
s2 = input("Enter time 2 HH:MM:SS")
Format1 = '%H:%M:%S'
tdiff = datetime.strptime(s1, Format1) - datetime.strptime(s2, Format1)
print(tdiff)
We are using the datetime class in datetime module for using strptime to find the difference between the two times.