Check your arrows
You have a quiver of arrows, but some have been damaged. The quiver contains arrows with an optional range information (different types of targets are positioned at different ranges), so each item is an arrow.

You need to verify that you have some good ones left, in order to prepare for battle:
```python
anyArrows([{'range': 5}, {'range': 10, 'damaged': True}, {'damaged': True}])
```

If an arrow in the quiver does not have a damaged status, it means it's new.

The expected result is a boolean, indicating whether you have any good arrows left.

Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Starter code: def any_arrows(arrows):
	

Solutions:
def any_arrows(arrows):
	return any((not i.get('damaged', False) for i in arrows))


def any_arrows(arrows):
	return any((not arrow.get('damaged', False) for arrow in arrows))


def any_arrows(arrows):
	return any([True for a in arrows if 'damaged' not in a or a['damaged'] == False])


def any_arrows(arrows):
	return not all((ar.get('damaged', False) for ar in arrows))


any_arrows = lambda arrows: any([not x['damaged'] if 'damaged' in x else True for x in arrows])


def any_arrows(arrows):
	has_good = False
	for arrow in arrows:
		is_damaged = arrow.get('damaged', False)
		if not is_damaged:
			has_good = True
			break
	return has_good


any_arrows = lambda a: any((not e['damaged'] if 'damaged' in e else True for e in a))


def any_arrows(arrows):
	return any((a.get('damaged', False) is False for a in arrows))


def any_arrows(arrows):
	return not all((arrow.get('damaged', False) for arrow in arrows))


def any_arrows(quiver):
	for arrow in quiver:
		if (arrow.get('range') is True or None) or not arrow.get('damaged'):
			return True
	return False


def any_arrows(arrows):
	return not all(map(lambda x: x['damaged'] if 'damaged' in x else False, arrows))


def any_arrows(arrows):
	return any((not a.get('damaged') for a in arrows))


def any_arrows(arrows):
	return any((not ar.get('damaged', False) for ar in arrows))


any_arrows = lambda q: any((not a.get('damaged') for a in q))


def any_arrows(arrows):
	return any((not x.get('damaged', False) for x in arrows))


def any_arrows(arrows):
	return sum((a.get('damaged', 0) for a in arrows)) < len(arrows)


any_arrows = lambda arrows: True in [arrow.get('damaged') != True for arrow in arrows]


def any_arrows(arrows):
	return True if ['undamaged' for i in arrows if not i.get('damaged')] else False


any_arrows = lambda q: 1 - all((a.get('damaged') for a in q))


def any_arrows(arrows):
	return not all((a.get('damaged', False) for a in arrows))


def any_arrows(arrows):
	try:
		return not (arrows == [] or all((x['damaged'] for x in arrows)))
	except KeyError:
		return True


def any_arrows(arrows):
	return not all(map(lambda d: d.get('damaged', False), arrows)) if arrows else False


from typing import List, Dict, Union

def any_arrows(arrows: List[Dict[str, Union[int, bool]]]) -> int:
	return bool(next(filter(lambda _arr: not _arr.get('damaged', False), arrows), False))


def any_arrows(arrows):
	if arrows:
		for arrow in arrows:
			if arrow.get('damaged'):
				continue
			else:
				return True
		return False
	else:
		return False


def any_arrows(arrows):
	if len(arrows) == 0:
		return False
	else:
		for arrow_info in arrows:
			if arrow_info.get('damaged') == None:
				return True
			elif arrow_info.get('damaged') == False:
				return True
		return False


def any_arrows(arrows):
	if arrows == []:
		return False
	else:
		for i in arrows:
			if i.get('damaged') is None:
				return True
				break
			elif i['damaged'] == False:
				return True
				break
		else:
			return False


def any_arrows(arrows):
	for dct in arrows:
		if 'damaged' not in dct.keys() or dct['damaged'] == False:
			return True
	return False


def any_arrows(arrows):
	if not arrows:
		status = False
	for arrow in arrows:
		if 'damaged' not in arrow or arrow['damaged'] == False:
			status = True
			break
		else:
			status = False
	return status


def any_arrows(arrows):
	damaged_test = [bundle.get('damaged') for bundle in arrows]
	return None in damaged_test or False in damaged_test


def any_arrows(arrows):
	return any((True for x in arrows if not x.get('damaged')))


def any_arrows(arrows):
	all_bools = []
	if len(arrows) < 1:
		return False
	for i in arrows:
		if i.get('range', 0) >= 0 and i.get('damaged', False) == False:
			all_bools.append(True)
		if i.get('range', 0) >= 0 and i.get('damaged') == True:
			all_bools.append(False)
	if True in all_bools:
		return True
	else:
		return False


def any_arrows(arrows):
	return bool([arrow for arrow in arrows if not arrow.get('damaged', False)])


from operator import __and__
from functools import reduce

def any_arrows(arrows):
	return not reduce(__and__, [x.get('damaged', False) for x in arrows], True)


def any_arrows(arrows):
	lst = []
	if arrows == []:
		lst.append(False)
	else:
		for arrow in arrows:
			if 'damaged' not in arrow.keys():
				lst.append(True)
			elif 'damaged' in arrow.keys() and arrow['damaged'] == False:
				lst.append(True)
			else:
				lst.append(False)
	return True in lst


def any_arrows(arrows):
	return bool([x for x in arrows if not x.setdefault('damaged', False)])


def any_arrows(arrows):
	status = [i.get('damaged') for i in arrows if 'damaged' in i]
	return not sum(status) == len(arrows)


def any_arrows(arrows):
	return False in [a.get('damaged', False) for a in arrows]


def any_arrows(arrows):
	if not arrows:
		return False
	for d in arrows:
		if any((d[k] == False for k in d)) or 'damaged' not in d.keys():
			return True
	return False


import re

def any_arrows(arrows):
	damaged_arrows = []
	good_arrows = []
	sorted_arrows = arrows.copy()
	sorted_arrows.sort(key=lambda arrow: arrow.get('range') if arrow.get('range') else 0, reverse=True)
	print(sorted_arrows)
	for arrow in sorted_arrows:
		if arrow.get('damaged'):
			damaged_arrows.append(arrow)
		else:
			good_arrows.append(arrow)
	print(damaged_arrows)
	print(good_arrows)
	return len(good_arrows) > 0


def any_arrows(arrows):
	for arr in arrows:
		if not ('damaged' in arr and arr['damaged']):
			return True
	return False


def any_arrows(arrows):
	l = list(filter(lambda x: x.get('damaged'), arrows))
	return len(l) < len(arrows)


def any_arrows(arrows):
	return len([arrow for arrow in arrows if arrow.get('damaged') != True]) > 0


def any_arrows(arrows):
	for arrow in arrows:
		if 'damaged' not in arrow.keys():
			return True
		elif arrow['damaged'] == False:
			return True
	else:
		return False


def any_arrows(arrows):
	return any([x for x in arrows if (True if 'damaged' not in list(x.keys()) or x['damaged'] is False else False)])


def any_arrows(arrows):
	count = 0
	for i in arrows:
		try:
			if not i['damaged']:
				return True
		except:
			return True
	return False


def any_arrows(arr):
	for i in arr:
		if True not in i.values():
			return True
	return False


def any_arrows(arrows):
	print(arrows)
	left = False
	if arrows == []:
		return False
	for status in arrows:
		if 'damaged' not in status:
			return True
		elif status['damaged'] is not True:
			return True
	return False


any_arrows = lambda arrows: any(('damaged' not in arrow or not arrow['damaged'] for arrow in arrows))


def any_arrows(arrows):
	return any([x for x in arrows if x.get('damaged') == False or x.get('damaged') == None])


def any_arrows(arrows):
	return not all(('damaged' in arrow and arrow['damaged'] for arrow in arrows))


def any_arrows(arrows):
	for arr in arrows:
		if 'damaged' in arr:
			if arr['damaged'] == False:
				return True
		else:
			return True
	return False


def any_arrows(arrows):
	for arrow in arrows:
		try:
			if arrow['damaged'] == False:
				return True
		except:
			return True
	return False


def any_arrows(arrows):
	return any(('damaged' not in arrow or arrow['damaged'] == False for arrow in arrows))


def any_arrows(arrows):
	if arrows == []:
		return False
	for i in arrows:
		if i.get('damaged', 0) == False:
			return True
	return False


def any_arrows(arrows):
	for a in arrows:
		if 'damaged' not in list(a.keys()):
			return True
		if a['damaged'] == False:
			return True
	return False


from functools import reduce

def any_arrows(arrows):
	if arrows:
		return reduce(lambda a, b: a or b, [not a.get('damaged', False) for a in arrows])
	else:
		return False


def any_arrows(arrows):
	quiver = False
	if arrows:
		for (n, x) in enumerate(arrows):
			for (k, v) in x.items():
				if k == 'range' and len(x.items()) == 1:
					quiver = True
					break
				if k == 'damaged' and v == False:
					quiver = True
					break
	return quiver


def any_arrows(arrows):
	try:
		for i in arrows:
			if 'damaged' in i:
				if i['damaged'] == False:
					return True
			else:
				return True
		return False
	except:
		return False


def any_arrows(arrows):
	dam = 0
	for i in arrows:
		if 'damaged' in i:
			if i['damaged'] == True:
				dam += 1
	return dam < len(arrows)


def any_arrows(arrows):
	return any(['damaged' not in a or not a['damaged'] for a in arrows])


def any_arrows(arrows):
	status = False
	for arrow in arrows:
		if not arrow.get('damaged', False):
			status = True
	return status


def any_arrows(arrows):
	print(arrows)
	for el in arrows:
		if el.get('damaged') != True:
			return True
	return False


def any_arrows(arrows):
	goodArrows = False
	for a in arrows:
		goodArrows = goodArrows or not a.get('damaged')
	return goodArrows


def any_arrows(arrows):
	if arrows:
		for d in arrows:
			if not 'damaged' in d:
				return True
			elif not d['damaged']:
				return True
	return False


def any_arrows(arrows):
	for arrow_dict in arrows:
		if 'damaged' not in arrow_dict or not arrow_dict['damaged']:
			return True
	return False


def any_arrows(arrows):
	return len([a for a in arrows if not a.get('damaged', False)]) != 0


def any_arrows(arrows):
	res = []
	for i in range(len(arrows)):
		if 'damaged' in list(arrows[i].keys()):
			if arrows[i]['damaged'] == True:
				res.append(True)
			else:
				res.append(False)
		else:
			res.append(False)
	return False in res


def any_arrows(arrows):
	return False in [arrow.get('damaged', False) for arrow in arrows]


def any_arrows(arrows):
	if arrows == []:
		return False
	else:
		for i in arrows:
			if not 'damaged' in i:
				return True
			elif i['damaged'] == False:
				return True
		return False


any_arrows = lambda arrows: any((not i.get('damaged', False) for i in arrows))


def any_arrows(arrows):
	if arrows == []:
		return False
	for dictionary in arrows:
		if 'damaged' not in dictionary:
			return True
		if 'damaged' in dictionary:
			if dictionary['damaged'] == False:
				return True
	return False


def any_arrows(arrows):
	damaged_arrows = 0
	total_arrows = 0
	for x in arrows:
		if 'damaged' in x:
			if x['damaged']:
				damaged_arrows += 1
		total_arrows += 1
	return total_arrows > damaged_arrows


def any_arrows(arrows):
	if not arrows:
		return False
	result = False
	for arrow in arrows:
		if 'damaged' not in arrow or arrow['damaged'] == False:
			result = result or True
		else:
			result = result or False
	return result


from typing import List, Dict, Union

def any_arrows(arrows: List[Dict[str, Union[str, bool]]]) -> bool:
	return any((not a.get('damaged', False) for a in arrows))


def any_arrows(arrows):
	return any([not arr['damaged'] if 'damaged' in arr.keys() else True for arr in arrows])


def any_arrows(arrows):
	return any([i.get('damaged', False) == False for i in arrows]) if arrows else False


any_arrows = lambda l: any((not x.get('damaged') for x in l))


def any_arrows(arrows):
	return False if all([i.get('damaged', False) for i in arrows]) else True


def any_arrows(arrows):
	for item in arrows:
		try:
			a = item['damaged']
			if not a:
				return True
		except:
			return True
	return False


def any_arrows(arrows):
	return False in [i.get('damaged', False) for i in arrows]


def any_arrows(arrows):
	for obj in arrows:
		if obj.get('damaged', False) == False:
			return True
	return False


def any_arrows(arrows):
	try:
		return min((i.get('damaged', 0) for i in arrows)) == 0
	except:
		return False


def any_arrows(a):
	for i in range(len(a)):
		if a[i].get('damaged') != True:
			return True
	return False


class Arrow:

	def __init__(self, range=5, damaged=False):
		self.range = range
		self.damaged = damaged

def any_arrows(arrows):
	quiver = []
	for arrow in arrows:
		if 'range' in arrow and 'damaged' in arrow:
			quiver.append(Arrow(arrow.get('range'), arrow.get('damaged')))
		elif 'range' in arrow:
			quiver.append(Arrow(range=arrow.get('range')))
		elif 'damaged' in arrow:
			quiver.append(Arrow(damaged=arrow.get('damaged')))
		else:
			quiver.append(Arrow())
	return False in [x.damaged for x in quiver]


def any_arrows(arrows):
	return sum((1 if 'damaged' not in list(each.keys()) or ('damaged' in list(each.keys()) and (not each['damaged'])) else 0 for each in arrows)) > 0


def any_arrows(arrows):
	return any((arrow for arrow in arrows if 'damaged' not in arrow or not bool(arrow['damaged'])))


def any_arrows(arrows):
	i = 0
	while i < len(arrows):
		if not arrows[i].get('damaged'):
			return True
		i = i + 1
	return False


def any_arrows(arrows):
	if arrows == []:
		return False
	else:
		for i in range(len(arrows)):
			if arrows[i].get('damaged') == False or arrows[i].get('damaged') == None:
				return True
				break
		return False


def any_arrows(arrows):
	for arrow in arrows:
		try:
			if arrow['damaged']:
				continue
		except KeyError:
			return True
		else:
			return True
	return False


def any_arrows(arrows):
	for i in arrows:
		if 'damaged' not in i.keys() or ('damaged' in i.keys() and i['damaged'] == False):
			return True
	return False