Untitled
from datetime import datetime time_format = "%H:%M" time1_str = input("Enter the first time (HH:MM): ") time2_str = input("Enter the second time (HH:MM): ") time1 = datetime.strptime(time1_str, time_format) time2 = datetime.strptime(time2_str, time_format) time_difference = time2 - time1 print("Time difference:", time_difference)