import bisect
# you can use the time module like katrielalex answer which a standard library
# in python, but sadly for me i become an addict to dateutil :)
from dateutil import parser
hour_to_get = parser.parse('20:18')
hours = ['19:30', '20:10', '20:30', '21:00', '22:00']
hours = map(parser.parse, hours) # Convert to datetime.
hours.sort() # In case the list of hours isn't sorted.
index = bisect.bisect(hours, hour_to_get)
if index in (0, len(hours) - 1):
print "there is no show running at the moment"
else:
print "running show started at %s " % hours[index-1]
Надеюсь, это поможет вам:)