10 lines
340 B
Python
10 lines
340 B
Python
def check_valid_time(time: int, relation_time: int, relation: str) -> bool:
|
|
if relation == 'ot':
|
|
return time < relation_time
|
|
elif relation == 'nt':
|
|
return time > relation_time
|
|
elif relation == 'eq':
|
|
return time == relation_time
|
|
else:
|
|
raise ValueError('Invalid relation: {}'.format(relation))
|