<commit_before>#!/bin/python


def contains(list, e):
	""" determines wheter e is contained in the list """
	for elem in list:
		if elem == e:
			return True
	return False


integer_list = [0,1,2,3]

print("")
print("Does the list contain 3?: %r" % contains(integer_list, 3))
print("Does the list contain 5?: %r" % contains(integer_list, 5))
print("")

list1 = [1,2,3,4]
list2 = [1,2,3,4,5,6,7]
list3 = [1,2,3,5]
# Now try to create a function which determines weather a list is contained in another list.
# Some tips:
# - use the contains function defined above in your function.
# - you want to check if each element in the sublist is contained in the list
# - you'll probably want to use boolean arithmetics, short example in boolean_arithmetic.py


def sublist_contains(list, sublist):
	# your code here
	all_contained = True
	for elem in sublist:
		all_contained = all_contained and contains(list, elem)
	return False




print("")
print("Expected True,  Actual %r" % sublist_contains(list2, list1))
print("Expected False, Actual %r" % sublist_contains(list3, list1))
print("")

<commit_msg>Changed some description for contains exercise. Added 'testcase'<commit_after>#!/bin/python


def contains(list, e):
	""" determines wheter e is contained in the list """
	for elem in list:
		if elem == e:
			return True
	return False


integer_list = [0,1,2,3]

print("")
print("Does the list contain 3?: %r" % contains(integer_list, 3))
print("Does the list contain 5?: %r" % contains(integer_list, 5))
print("")

list1 = [1,2,3,4]
list2 = [1,2,3,4,5,6,7]
list3 = [1,2,3,5]


# Create a function which determines weather a list is contained in another list.
# Some tips:
# - use the contains function defined above in your function.
# - you want to check if each element in the sublist is contained in the list
# - you can use boolean arithmetics, short example in boolean_arithmetic.py


def sublist_contains(list, sublist):
	# your code here
	return None
	




print("")
print("Expected True,  Actual %r" % sublist_contains(list2, list1))
print("Expected False, Actual %r" % sublist_contains(list3, list1))
print("Expected True,  Actual %r" % sublist_contains(list1, list1))
print("")


{'fraction_non_alphanumeric': 0.12259835315645014, 'fraction_numerical': 0.028362305580969808, 'mean_word_length': 4.6805194805194805, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5266958', 'n_tokens_mistral': 759, 'n_tokens_neox': 719, 'n_words': 267}