I'd like to create a list of hours that is a tuple of the 24-hour based time (in a digit) and a string representation of a 12-hour based time.
The format would be like this:
[(0, "12 AM"), (1, "1 AM), ..., (13, "1PM"), ... ]
I was able to get something like this
hours = [(0,"12 AM")]
hours += [(hour,str(hour) + " AM") for hour in range(1, 12)]
hours += [(12,"12 PM")]
hours += [(hour+12,str(hour) + " PM") for hour in range(1, 12)]
But I feel that there is a cleaner way of doing this, but can't figure it out.