Your friend has been out shopping for puppies (what a time to be alive!)... He arrives back with multiple dogs, and you simply do not know how to respond!

By repairing the function provided, you will find out exactly how you should respond, depending on the number of dogs he has.

The number of dogs will always be a number and there will always be at least 1 dog.

```r
The expected behaviour is as follows:
- Your friend has fewer than 10 dogs:                    "Hardly any"
- Your friend has at least 10 but fewer than 51 dogs:    "More than a handful!"
- Your friend has at least 51 but not exactly 101 dogs:  "Woah that's a lot of dogs!"
- Your friend has 101 dogs:                              "101 DALMATIANS!!!"

Your friend will always have between 1 and 101 dogs, inclusive.
```

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Starter code: def how_many_dalmatians(n):
	

Solutions:
def how_many_dalmatians(n):
	dogs = ['Hardly any', 'More than a handful!', "Woah that's a lot of dogs!", '101 DALMATIONS!!!']
	return dogs[0] if n <= 10 else dogs[1] if n <= 50 else dogs[3] if n == 101 else dogs[2]


responses = [(lambda n: n < 11, 'Hardly any'), (lambda n: n < 51, 'More than a handful!'), (lambda n: n == 101, '101 DALMATIONS!!!'), (lambda n: True, "Woah that's a lot of dogs!")]
how_many_dalmatians = lambda n: next((r for (p, r) in responses if p(n)))


DOGS = ((100, '101 DALMATIONS!!!'), (50, "Woah that's a lot of dogs!"), (10, 'More than a handful!'))

def how_many_dalmatians(n):
	return next((msg for (dogs, msg) in DOGS if n > dogs), 'Hardly any')


def how_many_dalmatians(n):
	dogs = ['Hardly any', 'More than a handful!', "Woah that's a lot of dogs!", '101 DALMATIONS!!!']
	return dogs[(n > 10) + (n > 50) + (n == 101) + (n > 101)]


how_many_dalmatians = lambda n: ['Hardly any', 'More than a handful!', "Woah that's a lot of dogs!", '101 DALMATIONS!!!'][sum([n > 10, n > 50, n >= 101])]


def how_many_dalmatians(number):
	dogs = ['Hardly any', 'More than a handful!', "Woah that's a lot of dogs!", '101 DALMATIONS!!!']
	if number <= 10:
		respond = dogs[0]
	elif number <= 50:
		respond = dogs[1]
	elif number <= 100:
		respond = dogs[2]
	else:
		number = 101
		respond = dogs[3]
	return respond


def how_many_dalmatians(n):
	n = int(n)
	if n <= 10:
		return 'Hardly any'
	elif n <= 50:
		return 'More than a handful!'
	elif n <= 100:
		return "Woah that's a lot of dogs!"
	elif n == 101:
		return '101 DALMATIONS!!!'


def how_many_dalmatians(number):
	return 'Hardly any' if number <= 10 else 'More than a handful!' if number <= 50 else '101 DALMATIONS!!!' if number == 101 else "Woah that's a lot of dogs!"


def how_many_dalmatians(n):
	dogs = ['Hardly any', 'More than a handful!', "Woah that's a lot of dogs!", '101 DALMATIONS!!!']
	respond = {n <= 10: dogs[0], n <= 50 and n > 10: dogs[1], n == 101: dogs[3]}.get(True, dogs[2])
	return respond


def how_many_dalmatians(number):
	if 1 <= number <= 10:
		return 'Hardly any'
	elif 11 <= number <= 50:
		return 'More than a handful!'
	elif 51 <= number <= 100:
		return "Woah that's a lot of dogs!"
	elif number == 101:
		return '101 DALMATIONS!!!'


def how_many_dalmatians(n):
	if n == 101:
		return '101 DALMATIONS!!!'
	elif n < 11:
		return 'Hardly any'
	elif n < 51:
		return 'More than a handful!'
	else:
		return "Woah that's a lot of dogs!"


def how_many_dalmatians(n):
	dogs = ['Hardly any', 'More than a handful!', "Woah that's a lot of dogs!", '101 DALMATIONS!!!']
	if n < 11:
		return dogs[0]
	elif n > 11 and n < 52:
		return dogs[1]
	elif n > 50 and n < 101:
		return dogs[2]
	elif n == 101:
		return dogs[3]


def how_many_dalmatians(n):
	msg = ['Hardly any', 'More than a handful!', "Woah that's a lot of dogs!", '101 DALMATIONS!!!']
	idx = {0: n <= 10, 1: 10 < n <= 50, 2: 50 < n <= 100, 3: n >= 101}
	for (k, v) in idx.items():
		if v:
			return msg[k]