# Story

Due to lack of maintenance the minute-hand has fallen off Town Hall clock face.

And because the local council has lost most of our tax money to a Nigerian email scam there are no funds to fix the clock properly. 

Instead, they are asking for volunteer programmers to write some code that tell the time by only looking at the remaining hour-hand!

What a bunch of cheapskates!

Can you do it?

# Kata

Given the ```angle``` (in degrees) of the hour-hand, return the time in HH:MM format. Round _down_ to the nearest minute.

# Examples

* ```12:00``` = 0 degrees


* ```03:00``` = 90 degrees


* ```06:00``` = 180 degrees


* ```09:00``` = 270 degrees


* ```12:00``` = 360 degrees

# Notes

* 0 <= ```angle``` <= 360

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Starter code: def what_time_is_it(angle):
	

Solutions:
def what_time_is_it(angle):
	hr = int(angle // 30)
	mn = int(angle % 30 * 2)
	if hr == 0:
		hr = 12
	return '{:02d}:{:02d}'.format(hr, mn)


def what_time_is_it(angle):
	angle %= 360
	(h, m) = divmod(angle, 30)
	return '{:02}:{:02}'.format(int(h or 12), int(m * 2))


import time

def what_time_is_it(angle):
	return time.strftime('%I:%M', time.gmtime(angle * 2 * 60))


def what_time_is_it(angle: float) -> str:
	(h, m) = list(map(int, divmod(2 * angle, 60)))
	return f'{h or 12:02d}:{m:02d}'


def what_time_is_it(angle):
	(q, r) = divmod(angle, 30)
	return f'{int(q) or 12:02d}:{int(2 * r):02d}'


what_time_is_it = lambda a: f'{str(int(a // 30) or 12).zfill(2)}:{str(int((a - 30 * (a // 30)) // 0.5)).zfill(2)}'


import math

def what_time_is_it(angle):
	mins = 2 * (angle % 360)
	h = math.floor(mins / 60) or 12
	m = math.floor(mins % 60)
	return '{:02}:{:02}'.format(h, m)


def what_time_is_it(angle):
	(hh, mm) = divmod(int(2 * angle), 60)
	return '{:02d}:{:02d}'.format(hh if hh else 12, mm)


def what_time_is_it(angle):
	(hour, minute) = divmod(angle, 30)
	hour = int(hour + 12 * (hour == 0))
	minute = int(minute * 2)
	return '{:02d}:{:02d}'.format(hour, minute)


def what_time_is_it(angle):
	h = angle // 30
	m = angle % 30 * 2
	return '%02d:%02d' % (h, m) if h else '12:%02d' % m


from math import floor

def what_time_is_it(angle):
	(hr, mt) = divmod(12 * angle, 360)
	if hr < 1:
		hr = 12
	hr = f'{floor(hr)}'.rjust(2, '0')
	mt = f'{floor(mt) // 6}'.rjust(2, '0')
	return f'{hr}:{mt}'


def what_time_is_it(angle):
	n = 60 * 12 * angle / 360
	return '%02d:%02d' % (int(n // 60) or 12, int(n % 60))


what_time_is_it = lambda a: '%02d:%02d' % (int(a / 30) or 12, a % 30 * 2)


def what_time_is_it(angle):
	return str(int(angle / 30) or 12).zfill(2) + ':' + str(int(angle % 30 * 2)).zfill(2)


def what_time_is_it(angle):
	minutes = int(angle * 2)
	hours = minutes // 60 or 12
	minutes %= 60
	return f'{hours:02}:{minutes:02}'


def what_time_is_it(n):
	from math import floor
	temp = n * 2
	hours = str(floor(temp / 60))
	minutes = str(floor(temp % 60))
	if temp // 60 == 0:
		hours = '12'
	if len(hours) == 1:
		hours = '0' + hours
	if len(minutes) == 1:
		minutes = '0' + minutes
	return hours + ':' + minutes


def what_time_is_it(angle):
	hour = str(int(angle // 30 or 12)).zfill(2)
	min = str(int(2 * (angle % 30))).zfill(2)
	return f'{hour}:{min}'


def what_time_is_it(angle):
	remain = int((angle - angle // 30 * 30) / 30 * 60)
	hour = int(angle / 30) if angle >= 30 else 12
	return '{:02d}'.format(hour) + ':' + '{:02d}'.format(remain) if remain else '{:02d}'.format(hour) + ':00'


def what_time_is_it(angle):
	if angle % 360 == 0:
		return '12:00'
	m = int(angle % 360 / 360 * 720)
	return '{}:{}'.format(str(m // 60).zfill(2) if m // 60 > 0 else '12', str(m % 60).zfill(2))