def clock_to_hours(clock_arg:str) -> float:
	"""convert a time hour string to its float representation of hours since midnight
	>>> clock_to_hours("18:45")
	18.75
	>>> clock_to_hours("18:40:21")
	18.6725
	>>> clock_to_hours("6:45pm")
	18.75
	>>> clock_to_hours("3am")
	3.0
	"""
	bias = 12 if "pm" in clock_arg else 0
	clock = clock_arg.replace("pm","").replace("am","")
	splitted = clock.split(":")
	hour_contributions = [float(s)/60**i for i,s in enumerate(splitted)]
	return bias + sum(hour_contributions)