## Your story
You've always loved both Fizz Buzz katas and cuckoo clocks, and when you walked by a garage sale and saw an ornate cuckoo clock with a missing pendulum, and a "Beyond-Ultimate Raspberry Pi Starter Kit" filled with all sorts of sensors and motors and other components, it's like you were suddenly hit by a beam of light and knew that it was your mission to combine the two to create a computerized Fizz Buzz cuckoo clock!

You took them home and set up shop on the kitchen table, getting more and more excited as you got everything working together just perfectly. Soon the only task remaining was to write a function to select from the sounds you had recorded depending on what time it was:

## Your plan
* When a minute is evenly divisible by three, the clock will say the word "Fizz".
* When a minute is evenly divisible by five, the clock will say the word "Buzz".
* When a minute is evenly divisible by both, the clock will say "Fizz Buzz", with two exceptions:
  1. On the hour, instead of "Fizz Buzz", the clock door will open, and the cuckoo bird will come out and "Cuckoo" between one and twelve times depending on the hour.
  2. On the half hour, instead of "Fizz Buzz", the clock door will open, and the cuckoo will come out and "Cuckoo" just once. 
* With minutes that are not evenly divisible by either three or five, at first you had intended to have the clock just say the numbers ala Fizz Buzz, but then you decided at least for version 1.0 to just have the clock make a quiet, subtle "tick" sound for a little more clock nature and a little less noise.

Your input will be a string containing hour and minute values in 24-hour time, separated by a colon, and with leading zeros. For example, 1:34 pm would be `"13:34"`.

Your return value will be a string containing the combination of Fizz, Buzz, Cuckoo, and/or tick sounds that the clock needs to make at that time, separated by spaces. Note that although the input is in 24-hour time, cuckoo clocks' cuckoos are in 12-hour time. 

## Some examples
```
"13:34"       "tick"
"21:00"       "Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo"
"11:15"       "Fizz Buzz"
"03:03"       "Fizz"
"14:30"       "Cuckoo"
"08:55"       "Buzz"
"00:00"       "Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo"
"12:00"       "Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo Cuckoo"
```
Have fun!

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Starter code: def fizz_buzz_cuckoo_clock(time):
	

Solutions:
def fizz_buzz_cuckoo_clock(t):
	(h, m) = list(map(int, t.split(':')))
	h = h - 12 if h > 12 else h + 12 if h == 0 else h
	if m == 0:
		return ' '.join(('Cuckoo' for i in range(h)))
	if m == 30:
		return 'Cuckoo'
	if m % 3 == 0 and m % 5 == 0:
		return 'Fizz Buzz'
	if m % 3 == 0:
		return 'Fizz'
	if m % 5 == 0:
		return 'Buzz'
	return 'tick'


def fizz_buzz_cuckoo_clock(time):
	(hours, minutes) = map(int, time.split(':'))
	hours = hours - 12 * (hours > 12) or 12
	if not minutes % 30:
		return ' '.join(['Cuckoo'] * (hours if not minutes else 1))
	return ' '.join(('Fizz' * (not minutes % 3), 'Buzz' * (not minutes % 5))).strip() or 'tick'


def fizz_buzz_cuckoo_clock(time):
	(h, m) = list(map(int, time.split(':')))
	if m % 30 < 1:
		return ' '.join(['Cuckoo'] * (m == 30 or (h - 1) % 12 + 1))
	else:
		return ('Fizz ' * (m % 3 < 1) + 'Buzz ' * (m % 5 < 1))[:-1] or 'tick'


def fizz_buzz_cuckoo_clock(time):
	(hh, mm) = map(int, time.split(':'))
	if mm == 0:
		return ' '.join(['Cuckoo'] * (hh % 12 or 12))
	elif mm == 30:
		return 'Cuckoo'
	elif mm % 15 == 0:
		return 'Fizz Buzz'
	elif mm % 3 == 0:
		return 'Fizz'
	elif mm % 5 == 0:
		return 'Buzz'
	else:
		return 'tick'


def fizz_buzz_cuckoo_clock(time):
	(hour, min) = [int(x) for x in time.split(':')]
	hour = hour % 12
	hour = 12 if hour == 0 else hour
	if min == 0:
		return ' '.join(hour * ['Cuckoo'])
	elif min == 30:
		return 'Cuckoo'
	elif min % 15 == 0:
		return 'Fizz Buzz'
	elif min % 5 == 0:
		return 'Buzz'
	elif min % 3 == 0:
		return 'Fizz'
	else:
		return 'tick'


fizz_buzz_cuckoo_clock = lambda t: ' '.join(['Cuckoo'] * (int(t[:2]) % 12 + 12 * (t[:2] in ['00', '12'])) if t[3:] == '00' else ['Cuckoo'] if t[3:] == '30' else ['Fizz'] * (int(t[3:]) % 3 == 0) + ['Buzz'] * (int(t[3:]) % 5 == 0) or ['tick'])


def fizz_buzz_cuckoo_clock(time):
	m = int(time[3:])
	h = int(time[:2])
	if m == 0:
		return ('Cuckoo ' * (h % 12 or 12))[:-1]
	elif m == 30:
		return 'Cuckoo'
	elif m % 3 == 0:
		if m % 5 == 0:
			return 'Fizz Buzz'
		else:
			return 'Fizz'
	elif m % 5 == 0:
		return 'Buzz'
	else:
		return 'tick'


def fizz_buzz_cuckoo_clock(time):
	(h, m) = list(map(int, time.split(':')))
	if m == 0:
		return ' '.join(['Cuckoo'] * ((h - 1) % 12 + 1))
	elif m == 30:
		return 'Cuckoo'
	elif m % 15 == 0:
		return 'Fizz Buzz'
	elif m % 3 == 0:
		return 'Fizz'
	elif m % 5 == 0:
		return 'Buzz'
	else:
		return 'tick'


import time

def fizz_buzz_cuckoo_clock(d):
	d = time.strptime(d, '%H:%M')
	(hour, sec) = (d.tm_hour, d.tm_min)
	o = ''
	if sec == 0:
		if 1 <= hour <= 12:
			o = ('Cuckoo' + ' ') * hour
		else:
			dic = {13: 1, 14: 2, 15: 3, 16: 4, 17: 5, 18: 6, 19: 7, 20: 8, 21: 9, 22: 10, 23: 11, 0: 12}
			o = ('Cuckoo' + ' ') * dic[hour]
	elif sec == 30:
		o = 'Cuckoo'
	elif sec % 3 == 0 and sec % 5 == 0:
		o = 'Fizz Buzz'
	elif sec % 3 == 0:
		o = 'Fizz'
	elif sec % 5 == 0:
		o = 'Buzz'
	else:
		o = 'tick'
	return o.rstrip()


def fizz_buzz_cuckoo_clock(time):
	(h, m) = map(int, time.split(':'))
	if m == 0:
		h = h if h in range(1, 13) else abs(h - 12)
		return ('Cuckoo ' * h).rstrip()
	if m == 30:
		return 'Cuckoo'
	if m % 3 == 0 and m % 5 == 0:
		return 'Fizz Buzz'
	if int(m) % 3 == 0:
		return 'Fizz'
	if m % 5 == 0:
		return 'Buzz'
	return 'tick'