You will be given an array `a` and a value `x`. All you need to do is check whether the provided array contains the value.

~~~if:swift
The type of `a` and `x` can be `String` or `Int`.
~~~
~~~if-not:swift
Array can contain numbers or strings. X can be either.
~~~
~~~if:racket
In racket, you'll be given a list instead of an array. If the value is in the list,
return #t instead of another value that is also considered true.
```racket
(contains '(1 2 3) 3) ; returns #t
(contains '(1 2 3) 5) ; returns #f
```
~~~

Return `true` if the array contains the value, `false` if not.

Source: codewars | Difficulty: EASY
Tags: String algorithms

Fundamentals

Data structures

Starter code: def check(seq, elem):
	

Solutions:
def check(seq, elem):
	return elem in seq


def check(list, x):
	while True:
		if x in list:
			return True
		else:
			return False
	pass


from operator import contains as check


def check(a, e):
	return e in a


def check(l, v):
	return v in l


def check(seq, elem):
	if elem in seq:
		return True
	return False


def check(seq, elem):
	for i in seq:
		if i == elem:
			return True
	return False


check = lambda seq, elem: elem in seq


check = lambda arr, e: e in arr


def check(seq, elem):
	try:
		seq.index(elem) >= 0
	except ValueError:
		return False
	return True


check = lambda s, e: e in s


def check(seq, elem):
	i = 0
	while i < len(seq):
		if elem == seq[i]:
			return True
		elif elem != seq[i] and i != len(seq) - 1:
			i = i + 1
		elif elem != seq[i] and i == len(seq) - 1:
			return False


from typing import List, Union

def check(seq: List[Union[int, str]], elem: Union[int, str]) -> bool:
	return elem in seq


def check(seq, target):
	return target in seq


def check(seq, elem):
	return elem in set(seq)

def check(seq, elem):
	return elem in seq
from operator import contains as check


def check(seq, elem):
	return any((x == elem for x in seq))


def check(seq, elem):
	valid = False
	for el in seq:
		if el == elem:
			valid = True
			break
	return valid


def check(seq, elem):
	for n in seq:
		if elem in seq:
			return True
		else:
			return False


def check(seq, elem):
	return list(seq).count(elem) > 0


def check(seq, elem):
	for i in range(len(seq)):
		if seq[i] != elem:
			pass
		else:
			return True
		if i == len(seq) - 1:
			return False


def check(seq, elem):
	x = []
	z = []
	for a in seq:
		if a == elem:
			x.append(a)
		elif a != elem:
			pass
	if x == z:
		return False
	else:
		return True


def check(seq, elem):
	for item in seq:
		if item == elem:
			return True
		else:
			continue
	return False


def check(a, x):
	if x not in a:
		return False
	else:
		return True


def check(seq, elem):
	for value in seq:
		if elem in seq:
			return 1
		else:
			return 0


def check(seq, elem):
	for unit in seq:
		if unit == elem:
			return True
			break
	return False


def check(wordlist, elem):
	if elem in wordlist:
		return True
	else:
		return False
print(check(["when's", 'the', 'next', 'Katathon?', 9, 7], 'Kaathon?'))


def check(seq, elem):
	grade = 0
	for i in seq:
		if i == elem:
			grade += 1
	if grade > 0:
		return True
	else:
		return False


seq = [1, 2, 3, 'cat']

def check(seq, elem):
	if elem in seq:
		return True
	else:
		return False
print(check(seq, 4))


def check(seq, elem):
	for i in range(len(seq)):
		if elem == seq[i]:
			return True
			break
	else:
		return False


def check(seq, elem):
	if str(elem) not in str(seq):
		return False
	elif elem not in seq:
		return False
	else:
		return True


def check(seq, elem):
	tot = 0
	for i in range(len(seq)):
		if str(seq[i]) == str(elem):
			tot += 1
	if tot > 0:
		return True
	return False


def check(seq, elem):
	for i in range(len(seq)):
		if seq[i] == elem and type(seq[i]) == type(elem):
			return True
	return False


def check(seq, elem):
	truth = False
	for terms in seq:
		if terms == elem:
			truth = True
			break
	return truth


def check(arr, elem):
	if arr.count(elem) > 0:
		return True
	else:
		return False


def check(seq, elem):
	flag = False
	for i in seq:
		if str(i) == str(elem):
			flag = True
			break
	return flag


def check(seq, elem):
	i = 0
	for i in range(len(seq)):
		try:
			itshere = seq.index(elem)
			return True
		except ValueError:
			return False


def check(seq, elem):
	result = False
	for n in seq:
		if n == elem:
			result = True
			break
		else:
			continue
	return result


def check(seq, elem):
	if seq.count(elem) >= 1:
		return True
	return False
	check([10, 1], 5)


def check(b, c):
	if c in b:
		return True
	else:
		return False


def check(seq, elem):
	return (False, True)[seq.count(elem) > 0]


def check(seq: list, elem) -> bool:
	for item in seq:
		if elem == item:
			return True
	return False


def check(seq, elem):
	x = len(seq)
	for i in range(x):
		if seq[i] == elem:
			return True
	return False
	pass


def check(seq, elem):
	return {k: True for (v, k) in enumerate(seq)}.get(elem, False)


def check(s, elem) -> bool:
	for i in s:
		if elem is i:
			return True
	return False


def check(seq, elem):
	for sequelem in seq:
		if sequelem == elem:
			return True
	else:
		return False


def check(seq, elem):
	for elemseq in seq:
		if elem == elemseq:
			return True
	else:
		return False


def check(seq, elem):
	for seqelem in seq:
		if seqelem == elem:
			return True
	else:
		return False


check = lambda s, i: i in s


def check(seq, elem):
	for k in seq:
		if k == elem:
			return True
	return False


def check(seq, elem):
	for element in seq:
		if elem in seq:
			return True
		else:
			return False


def check(seq, elem):
	try:
		if seq.index(elem) >= 0:
			return True
	except:
		return False


def check(seq, elem):
	for i in range(len(seq)):
		if seq[i] == elem:
			return True
	else:
		return False
check([1, 2, 3, 's', 5], 'w')


def check(seq, element):
	flag = []
	for elem in seq:
		if elem == element:
			flag.append(1)
		else:
			flag.append(0)
	if sum(flag) > 0:
		return True
	else:
		return False


def check(a, x):
	if x in a:
		return True
	elif x not in a:
		return False


def check(a, x):
	c = 0
	for i in range(len(a)):
		if a[i] == x:
			c = 1
	if c == 1:
		return True
	else:
		return False


def check(a, x):
	for b in a:
		if b == x:
			return True
	return False


def check(seq, elem):
	for value in seq:
		if elem == value:
			return True
	return False


def check(array, elem):
	if array.count(elem) > 0:
		return True
	return False


def check(seq, elem):
	bool = False
	for i in range(len(seq)):
		if seq[i] == elem:
			bool = True
	return bool


def check(b, a):
	if a in b:
		return True
	else:
		return False


def check(seq, elem):
	count = 0
	for item in seq:
		if item == elem:
			count += 1
		else:
			count += 0
	if count > 0:
		return True
	else:
		return False


def check(a, x):
	check = 0
	if a.count(x) <= 1:
		check = check + 1
	if check == 1:
		return a.count(x)
	elif check <= 2:
		return True
	else:
		return False


def check(seq, elem):
	if elem in seq:
		answer = True
	else:
		answer = False
	return answer


def check(seq, elem):
	for nums in seq:
		if nums == seq or nums == elem:
			return True
	return False


def check(seq, elem):
	if elem in seq or str(elem) in seq:
		return True
	else:
		return False


def check(seq, elem):
	k = 0
	for i in range(len(seq)):
		if seq[i] == elem:
			k += 1
	if k > 0:
		return True
	else:
		return False


def check(seq, elem):
	marker = False
	for _ in seq:
		if elem == _:
			return True
	return marker


def check(luvut, elem):
	if elem in luvut:
		return True
	return False


def check(seq, elem):
	a = 0
	for item in seq:
		if item == elem:
			a += 1
			break
	if a == 1:
		return True
	else:
		return False


def check(seq, elem):
	if elem in seq == True:
		return False
	elif elem in seq != True:
		return True
	else:
		return False


def check(seq, elem):
	return any([True for x in seq if x == elem])


def check(arr, elem):
	return elem in arr


def check(seq, elem):
	if elem in seq:
		x = True
		return x
	else:
		x = False
		return x


def check(seq, elem):
	seq.append(elem)
	return bool(seq.count(elem) - 1)


def check(seq, elem):
	total = 0
	print(len(seq))
	for i in seq:
		if i == elem:
			return True
		else:
			total += 1
			if total == len(seq):
				return False


def check(seq: list, elem: [str, int]) -> bool:
	return elem in seq


def check(seq, elem):
	if seq.count(elem) > 0:
		return True
	else:
		return False


import random

def check(seq, elem):
	random.choice(seq)
	if elem in seq:
		return True
	else:
		return False


def check(seq, elem):
	while elem in seq:
		return True
	return False
	pass