

--------------------------------------------------Mbpp/2--------------------------------------------------

<s> """
Write a function to find the shared elements from the given two lists.
assert set(similar_elements((3, 4, 5, 6),(5, 7, 4, 10))) == set((4, 5))
"""


def similar_elements(list1, list2):
    """
    Write a function to find the shared elements from the given two lists.
    assert set(similar_elements((3, 4, 5, 6),(5, 7, 4, 10))) == set((4, 5))
    """
    return set(list1).intersection(set(list2))




--------------------------------------------------Mbpp/3--------------------------------------------------

<s> """
Write a python function to identify non-prime numbers.
assert is_not_prime(2) == False
"""


def is_not_prime(n):
    """
    Write a python function to identify non-prime numbers.
    assert is_not_prime(2) == False
    """
    if n == 1:
        return False
    for i in range(2, n):
        if n % i == 0:
            return True
    return False




--------------------------------------------------Mbpp/4--------------------------------------------------

<s> """
Write a function to find the n largest integers from a given list of numbers, returned in descending order.
assert heap_queue_largest( [25, 35, 22, 85, 14, 65, 75, 22, 58],3)==[85, 75, 65]
"""


def heap_queue_largest(nums, n):
    """
    :param nums: list of numbers
    :param n: number of largest integers
    :return: descending order list of n largest integers
    """
    heap = []
    for num in nums:
        if len(heap) < n:
            heapq.heappush(heap, num)
        else:
            if num > heap[0]:
                heapq.heappop(heap)
                heapq.heappush(heap, num)
    return heap




--------------------------------------------------Mbpp/6--------------------------------------------------

<s> """
Write a python function to check whether the two numbers differ at one bit position only or not.
assert differ_At_One_Bit_Pos(13,9) == True
"""


def differ_At_One_Bit_Pos(a, b):
    return bin(a ^ b).count('1') == 1




--------------------------------------------------Mbpp/7--------------------------------------------------

<s> """
Write a function to find all words which are at least 4 characters long in a string.
assert set(find_char_long('Please move back to stream')) == set(['Please', 'move', 'back', 'stream'])
"""


def find_char_long(string):
    words = string.split()
    return [word for word in words if len(word) >= 4]




--------------------------------------------------Mbpp/8--------------------------------------------------

<s> """
Write a function to find squares of individual elements in a list.
assert square_nums([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])==[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
"""


def square_nums(nums):
    """
    Write a function to find squares of individual elements in a list.
    assert square_nums([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])==[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
    """
    return [num ** 2 for num in nums]




--------------------------------------------------Mbpp/9--------------------------------------------------

<s> """
Write a python function to find the minimum number of rotations (greater than 0) required to get the same string.
assert find_Rotations("aaaa") == 1
"""


def find_rotations(string):
    """
    :param string: string
    :return: minimum number of rotations (greater than 0) required to get the same string
    """
    if len(string) == 1:
        return 0
    if len(string) == 2:
        return 1
    if len(string) == 3:
        return 2
    if len(string) == 4:
        return 3
    if len(string) == 5:
        return 4
    if len(string) == 6:
        return 5
    if len(string) == 7:
        return 6
    if len(string) == 8:
        return 7
    if len(string) == 9:
        return 8
    if len(string) == 10:
        return 9
    if len(string) == 11:
        return 10
    if len(string) == 12:
        return 11
    if len(string) == 13:
        return 12
    if len(string) == 14:
        return 13
    if len(string) == 15:
        return 14
    if len(string) == 16:
        return 15
    if len(string) == 17:
        return 16
    if len(string) == 18:
        return 17
    if len(string) == 19:
        return 18
    if len(string) == 20:
        return 19
    if len(string) == 21:
        return 20
    if len(string) == 22:
        return 21

--------------------------------------------------Mbpp/11--------------------------------------------------

<s> """
Write a python function to remove first and last occurrence of a given character from the string.
assert remove_Occ("hello","l") == "heo"
"""


def remove_Occ(string, char):
    return string[1:-1].replace(char, "")




--------------------------------------------------Mbpp/12--------------------------------------------------

<s> """
Write a function to sort a given matrix in ascending order according to the sum of its rows.
assert sort_matrix([[1, 2, 3], [2, 4, 5], [1, 1, 1]])==[[1, 1, 1], [1, 2, 3], [2, 4, 5]]
"""


def sort_matrix(matrix):
    """
    Sort a given matrix in ascending order according to the sum of its rows.
    :param matrix:
    :return:
    """
    matrix_sum = [sum(row) for row in matrix]
    matrix_sum_index = sorted(range(len(matrix_sum)), key=lambda k: matrix_sum[k])
    return [matrix[i] for i in matrix_sum_index]




--------------------------------------------------Mbpp/14--------------------------------------------------

<s> """
Write a python function to find the volume of a triangular prism.
assert find_Volume(10,8,6) == 240
"""

def find_Volume(base,height,length):
    return (base*height)/3



--------------------------------------------------Mbpp/16--------------------------------------------------

<s> """
Write a function to that returns true if the input string contains sequences of lowercase letters joined with an underscore and false otherwise.
assert text_lowercase_underscore("aab_cbbbc")==(True)
"""


def text_lowercase_underscore(text):
    """
    :param text: input string
    :return: True if the input string contains sequences of lowercase letters joined with an underscore and false otherwise.
    """
    if text.islower() and '_' in text:
        return True
    else:
        return False




--------------------------------------------------Mbpp/17--------------------------------------------------

<s> """
Write a function that returns the perimeter of a square given its side length as input.
assert square_perimeter(10)==40
"""


def square_perimeter(side_length):
    return side_length * 4




--------------------------------------------------Mbpp/18--------------------------------------------------

<s> """
Write a function to remove characters from the first string which are present in the second string.
assert remove_dirty_chars("probasscurve", "pros") == 'bacuve'
"""


def remove_dirty_chars(first_string, second_string):
    """
    Write a function to remove characters from the first string which are present in the second string.
    assert remove_dirty_chars("probasscurve", "pros") == 'bacuve'
    """
    return ''.join([char for char in first_string if char not in second_string])




--------------------------------------------------Mbpp/19--------------------------------------------------

<s> """
Write a function to find whether a given array of integers contains any duplicate element.
assert test_duplicate(([1,2,3,4,5]))==False
"""


def test_duplicate(nums):
    if len(nums) == len(set(nums)):
        return False
    else:
        return True




--------------------------------------------------Mbpp/20--------------------------------------------------

<s> """
Write a function to check if the given number is woodball or not.
assert is_woodall(383) == True
"""


def is_woodball(num):
    """
    :param num: int
    :return: bool
    """
    if num < 100:
        return False
    if num % 10 == num // 100:
        return True
    return False




--------------------------------------------------Mbpp/56--------------------------------------------------

<s> """
Write a python function to check if a given number is one less than twice its reverse.
assert check(70) == False
"""


def check(num):
    rev = 0
    while num > 0:
        rev = rev * 10 + num % 10
        num = num // 10
    return rev + 1 == num * 2




--------------------------------------------------Mbpp/57--------------------------------------------------

<s> """
Write a python function to find the largest number that can be formed with the given list of digits.
assert find_Max_Num([1,2,3]) == 321
"""


def find_Max_Num(digits):
    digits.sort(reverse=True)
    num = 0
    for digit in digits:
        num = num * 10 + digit
    return num




--------------------------------------------------Mbpp/58--------------------------------------------------

<s> """
Write a python function to check whether the given two integers have opposite sign or not.
assert opposite_Signs(1,-2) == True
"""


def opposite_signs(a, b):
    if a > 0 and b < 0 or a < 0 and b > 0:
        return True
    else:
        return False




--------------------------------------------------Mbpp/59--------------------------------------------------

<s> """
Write a function to find the nth octagonal number.
assert is_octagonal(5) == 65
"""


def is_octagonal(n):
    """
    >>> is_octagonal(5)
    True
    >>> is_octagonal(6)
    False
    """
    if n < 1:
        return False
    for i in range(1, n + 1):
        if is_octagonal_number(i):
            return True
    return False




--------------------------------------------------Mbpp/61--------------------------------------------------

<s> """
Write a python function to count the number of substrings with the sum of digits equal to their length.
assert count_Substrings('112112') == 6
"""


def count_Substrings(s):
    count = 0
    for i in range(len(s)):
        for j in range(i, len(s)):
            sum_digits = sum(int(x) for x in s[i:j+1])
            if sum_digits == j+1-i:
                count += 1
    return count




--------------------------------------------------Mbpp/62--------------------------------------------------

<s> """
Write a python function to find smallest number in a list.
assert smallest_num([10, 20, 1, 45, 99]) == 1
"""


def smallest_num(nums):
    """
    :param nums: list of numbers
    :return: smallest number in the list
    """
    return min(nums)




--------------------------------------------------Mbpp/63--------------------------------------------------

<s> """
Write a function to find the maximum difference between available pairs in the given tuple list.
assert max_difference([(3, 5), (1, 7), (10, 3), (1, 2)]) == 7
"""


def max_difference(tuple_list):
    """
    :param tuple_list: tuple list
    :return: maximum difference
    """
    tuple_list.sort()
    max_diff = 0
    for i in range(len(tuple_list) - 1):
        max_diff = max(max_diff, tuple_list[i + 1][0] - tuple_list[i][1])
    return max_diff




--------------------------------------------------Mbpp/64--------------------------------------------------

<s> """
Write a function to sort a list of tuples using the second value of each tuple.
assert subject_marks([('English', 88), ('Science', 90), ('Maths', 97), ('Social sciences', 82)])==[('Social sciences', 82), ('English', 88), ('Science', 90), ('Maths', 97)]
"""


def subject_marks(subject_marks):
    """
    Write a function to sort a list of tuples using the second value of each tuple.
    assert subject_marks([('English', 88), ('Science', 90), ('Maths', 97), ('Social sciences', 82)])==[('Social sciences', 82), ('English', 88), ('Science', 90), ('Maths', 97)]
    """
    subject_marks.sort(key=lambda x: x[1], reverse=True)
    return subject_marks




--------------------------------------------------Mbpp/65--------------------------------------------------

<s> """
Write a function to flatten a list and sum all of its elements.
assert recursive_list_sum(([1, 2, [3,4],[5,6]]))==21
"""


def recursive_list_sum(lst):
    """
    Flatten a list and sum all of its elements.
    :param lst: list
    :return: int
    """
    if not isinstance(lst, list):
        return lst
    return sum(recursive_list_sum(x) for x in lst)




--------------------------------------------------Mbpp/66--------------------------------------------------

<s> """
Write a python function to count the number of positive numbers in a list.
assert pos_count([1,-2,3,-4]) == 2
"""

def pos_count(nums):
    count = 0
    for num in nums:
        if num > 0:
            count += 1
    return count



--------------------------------------------------Mbpp/67--------------------------------------------------

<s> """
Write a function to find the number of ways to partition a set of Bell numbers.
assert bell_number(2)==2
"""


def bell_number(n):
    """
    Write a function to find the number of ways to partition a set of Bell numbers.
    assert bell_number(2)==2
    """
    if n == 0:
        return 1
    if n == 1:
        return 1
    if n == 2:
        return 2
    return bell_number(n - 1) + bell_number(n - 2)




--------------------------------------------------Mbpp/68--------------------------------------------------

<s> """
Write a python function to check whether the given array is monotonic or not.
assert is_Monotonic([6, 5, 4, 4]) == True
"""


def is_Monotonic(arr):
    for i in range(len(arr) - 1):
        if arr[i] > arr[i + 1]:
            return False
    return True




--------------------------------------------------Mbpp/69--------------------------------------------------

<s> """
Write a function to check whether a list contains the given sublist or not.
assert is_sublist([2,4,3,5,7],[3,7])==False
"""


def is_sublist(list1, list2):
    if len(list1) > len(list2):
        return False
    else:
        for i in range(len(list1)):
            if list1[i] == list2[i]:
                continue
            else:
                return False
        return True




--------------------------------------------------Mbpp/70--------------------------------------------------

<s> """
Write a function to find whether all the given tuples have equal length or not.
assert get_equal([(11, 22, 33), (44, 55, 66)]) == True
"""


def get_equal(tuples):
    """
    :param tuples: list of tuples
    :return: boolean
    """
    if not tuples:
        return False
    length = len(tuples[0])
    for t in tuples:
        if len(t) != length:
            return False
    return True




--------------------------------------------------Mbpp/71--------------------------------------------------

<s> """
Write a function to sort a list of elements.
assert comb_sort([5, 15, 37, 25, 79]) == [5, 15, 25, 37, 79]
"""


def comb_sort(arr):
    gap = len(arr)
    swapped = True
    while gap > 1 or swapped:
        gap = int(gap / 1.247330950103979)
        swapped = False
        for i in range(len(arr) - gap):
            if arr[i] > arr[i + gap]:
                arr[i], arr[i + gap] = arr[i + gap], arr[i]
                swapped = True
    return arr




--------------------------------------------------Mbpp/72--------------------------------------------------

<s> """
Write a python function to check whether the given number can be represented as the difference of two squares or not.
assert dif_Square(5) == True
"""


def dif_Square(n):
    for i in range(int(n**0.5)+1):
        if n == i**2 + (n-i)**2:
            return True
    return False




--------------------------------------------------Mbpp/74--------------------------------------------------

<s> """
Write a function to check whether it follows the sequence given in the patterns array.
assert is_samepatterns(["red","green","green"], ["a", "b", "b"])==True
"""


def is_samepatterns(patterns, colors):
    if len(patterns) != len(colors):
        return False
    for i in range(len(patterns)):
        if patterns[i] != colors[i] * len(patterns):
            return False
    return True




--------------------------------------------------Mbpp/75--------------------------------------------------

<s> """
Write a function to find tuples which have all elements divisible by k from the given list of tuples.
assert find_tuples([(6, 24, 12), (7, 9, 6), (12, 18, 21)], 6) == [(6, 24, 12)]
"""


def find_tuples(tuples, k):
    return [tuple(divisible_elements(t, k) for t in tuples)]




--------------------------------------------------Mbpp/77--------------------------------------------------

<s> """
Write a python function to find whether a number is divisible by 11.
assert is_Diff (12345) == False
"""


def is_divisible_by_11(num):
    """
    :param num: int
    :return: bool
    """
    if num < 0:
        return False
    if num == 0:
        return True
    if num % 11 == 0:
        return True
    return False




--------------------------------------------------Mbpp/79--------------------------------------------------

<s> """
Write a python function to check whether the length of the word is odd or not.
assert word_len("Hadoop") == False
"""


def word_len(word):
    if len(word) % 2 == 0:
        return True
    else:
        return False




--------------------------------------------------Mbpp/80--------------------------------------------------

<s> """
Write a function to find the nth tetrahedral number.
assert tetrahedral_number(5) == 35
"""


def tetrahedral_number(n):
    """
    Write a function to find the nth tetrahedral number.
    assert tetrahedral_number(5) == 35
    """
    return (n * (n + 1) * (n + 2)) / 6




--------------------------------------------------Mbpp/82--------------------------------------------------

<s> """
Write a function to find the volume of a sphere.
assert math.isclose(volume_sphere(10), 4188.790204786391, rel_tol=0.001)
"""



--------------------------------------------------Mbpp/83--------------------------------------------------

<s> """
Write a python function to find the character made by adding the ASCII value of all the characters of the given string modulo 26.
assert get_Char("abc") == "f"
"""


def get_char(string):
    sum = 0
    for i in string:
        sum += ord(i)
    sum = sum % 26
    return chr(sum)




--------------------------------------------------Mbpp/84--------------------------------------------------

<s> """
Write a function to find the nth number in the newman conway sequence.
assert sequence(10) == 6
"""


def newman_conway(n):
    """
    Write a function to find the nth number in the newman conway sequence.
    assert sequence(10) == 6
    """
    if n == 1:
        return 1
    elif n == 2:
        return 1
    else:
        return newman_conway(n-1) + newman_conway(n-2)




--------------------------------------------------Mbpp/85--------------------------------------------------

<s> """
Write a function to find the surface area of a sphere.
assert math.isclose(surfacearea_sphere(10), 1256.6370614359173, rel_tol=0.001)
"""



--------------------------------------------------Mbpp/86--------------------------------------------------

<s> """
Write a function to find nth centered hexagonal number.
assert centered_hexagonal_number(10) == 271
"""


def centered_hexagonal_number(n):
    """
    Write a function to find nth centered hexagonal number.
    assert centered_hexagonal_number(10) == 271
    """
    if n == 1:
        return 1
    else:
        return 2 * (2 * n - 1)




--------------------------------------------------Mbpp/87--------------------------------------------------

<s> """
Write a function to merge three dictionaries into a single dictionary.
assert merge_dictionaries_three({ "R": "Red", "B": "Black", "P": "Pink" }, { "G": "Green", "W": "White" },{ "O": "Orange", "W": "White", "B": "Black" })=={'B': 'Black', 'R': 'Red', 'P': 'Pink', 'G': 'Green', 'W': 'White', 'O': 'Orange'}
"""


def merge_dictionaries_three(dict1, dict2, dict3):
    """
    :param dict1: dictionary
    :param dict2: dictionary
    :param dict3: dictionary
    :return: dictionary
    """
    merged_dict = {}
    for key, value in dict1.items():
        merged_dict[key] = value
    for key, value in dict2.items():
        merged_dict[key] = value
    for key, value in dict3.items():
        merged_dict[key] = value
    return merged_dict




--------------------------------------------------Mbpp/88--------------------------------------------------

<s> """
Write a function to get the frequency of all the elements in a list, returned as a dictionary.
assert freq_count([10,10,10,10,20,20,20,20,40,40,50,50,30])==({10: 4, 20: 4, 40: 2, 50: 2, 30: 1})
"""


def freq_count(lst):
    """
    :param lst: list
    :return: dict
    """
    return {k: lst.count(k) for k in set(lst)}




--------------------------------------------------Mbpp/89--------------------------------------------------

<s> """
Write a function to find the closest smaller number than n.
assert closest_num(11) == 10
"""


def closest_num(n):
    """
    Write a function to find the closest smaller number than n.
    assert closest_num(11) == 10
    """
    if n == 1:
        return 1
    if n == 2:
        return 1
    if n == 3:
        return 2
    if n == 4:
        return 2
    if n == 5:
        return 3
    if n == 6:
        return 3
    if n == 7:
        return 4
    if n == 8:
        return 4
    if n == 9:
        return 5
    if n == 10:
        return 5
    if n == 11:
        return 6
    if n == 12:
        return 6
    if n == 13:
        return 7
    if n == 14:
        return 7
    if n == 15:
        return 8
    if n == 16:
        return 8
    if n == 17:
        return 9
    if n == 18:
        return 9
    if n == 19:
        return 10
    if n == 20:
        return 10
    if n == 21:
        return 11
    if n == 22:
        return 11

--------------------------------------------------Mbpp/90--------------------------------------------------

<s> """
Write a python function to find the length of the longest word.
assert len_log(["python","PHP","bigdata"]) == 7
"""


def len_longest_word(words):
    """
    :type words: List[str]
    :rtype: int
    """
    return max(map(len, words))




--------------------------------------------------Mbpp/91--------------------------------------------------

<s> """
Write a function to check if a string is present as a substring in a given list of string values.
assert find_substring(["red", "black", "white", "green", "orange"],"ack")==True
"""


def find_substring(list_of_strings, substring):
    for string in list_of_strings:
        if substring in string:
            return True
    return False




--------------------------------------------------Mbpp/92--------------------------------------------------

<s> """
Write a function to check whether the given number is undulating or not.
assert is_undulating(1212121) == True
"""


def is_undulating(num):
    """
    :param num: int
    :return: bool
    """
    if num == 0:
        return False
    if num == 1:
        return True
    if num == 2:
        return False
    if num == 3:
        return True
    if num == 4:
        return False
    if num == 5:
        return True
    if num == 6:
        return False
    if num == 7:
        return True
    if num == 8:
        return False
    if num == 9:
        return True
    if num == 10:
        return False
    if num == 11:
        return True
    if num == 12:
        return False
    if num == 13:
        return True
    if num == 14:
        return False
    if num == 15:
        return True
    if num == 16:
        return False
    if num == 17:
        return True
    if num == 18:
        return False
    if num == 19:
        return True
    if num == 20:
        return False
    if num == 21:
        return True

--------------------------------------------------Mbpp/93--------------------------------------------------

<s> """
Write a function to calculate the value of 'a' to the power 'b'.
assert power(3,4) == 81
"""


def power(a, b):
    """
    Write a function to calculate the value of 'a' to the power 'b'.
    assert power(3,4) == 81
    """
    if b == 0:
        return 1
    if b < 0:
        return 1 / power(a, -b)
    if b == 1:
        return a
    if b % 2 == 0:
        return power(a, b // 2) * power(a, b // 2)
    else:
        return a * power(a, b // 2) * power(a, b // 2)




--------------------------------------------------Mbpp/94--------------------------------------------------

<s> """
Given a list of tuples, write a function that returns the first value of the tuple with the smallest second value.
assert index_minimum([('Rash', 143), ('Manjeet', 200), ('Varsha', 100)]) == 'Varsha'
"""


def index_minimum(tuples):
    """
    >>> index_minimum([('Rash', 143), ('Manjeet', 200), ('Varsha', 100)])
    'Varsha'
    """
    return min(tuples, key=lambda x: x[1])[0]




--------------------------------------------------Mbpp/95--------------------------------------------------

<s> """
Write a python function to find the length of the smallest list in a list of lists.
assert Find_Min_Length([[1],[1,2]]) == 1
"""


def Find_Min_Length(list_of_lists):
    min_length = len(list_of_lists[0])
    for i in list_of_lists:
        if len(i) < min_length:
            min_length = len(i)
    return min_length




--------------------------------------------------Mbpp/96--------------------------------------------------

<s> """
Write a python function to find the number of divisors of a given integer.
assert divisor(15) == 4
"""


def divisor(n):
    count = 0
    for i in range(1, n+1):
        if n % i == 0:
            count += 1
    return count




--------------------------------------------------Mbpp/97--------------------------------------------------

<s> """
Write a function to find frequency of each element in a flattened list of lists, returned in a dictionary.
assert frequency_lists([[1, 2, 3, 2], [4, 5, 6, 2], [7, 8, 9, 5]])=={1: 1, 2: 3, 3: 1, 4: 1, 5: 2, 6: 1, 7: 1, 8: 1, 9: 1}
"""


def frequency_lists(lists):
    """
    :param lists: flattened list of lists
    :return: dictionary of frequency of each element
    """
    return {element: lists.count(element) for element in lists}




--------------------------------------------------Mbpp/98--------------------------------------------------

<s> """
Write a function to multiply all the numbers in a list and divide with the length of the list.
assert math.isclose(multiply_num((8, 2, 3, -1, 7)), -67.2, rel_tol=0.001)
"""


--------------------------------------------------Mbpp/99--------------------------------------------------

<s> """
Write a function to convert the given decimal number to its binary equivalent, represented as a string with no leading zeros.
assert decimal_to_binary(8) == '1000'
"""


def decimal_to_binary(n):
    if n == 0:
        return '0'
    binary = ''
    while n > 0:
        binary = str(n % 2) + binary
        n = n // 2
    return binary




--------------------------------------------------Mbpp/100--------------------------------------------------

<s> """
Write a function to find the next smallest palindrome of a specified integer, returned as an integer.
assert next_smallest_palindrome(99)==101
"""


def next_smallest_palindrome(n):
    """
    :param n: int
    :return: int
    """
    if n < 10:
        return n
    if n % 10 == 0:
        return n + 1
    if n % 10 == 1:
        return n - 1
    if n % 10 == 5:
        return n + 2
    if n % 10 == 9:
        return n - 2
    if n % 10 == 4:
        return n + 3
    if n % 10 == 8:
        return n - 3
    if n % 10 == 7:
        return n + 4
    if n % 10 == 6:
        return n - 4
    if n % 10 == 3:
        return n + 5
    if n % 10 == 2:
        return n - 5
    if n % 10 == 1:
        return n + 6
    if n % 10 == 0:
        return n - 6




--------------------------------------------------Mbpp/101--------------------------------------------------

<s> """
Write a function to find the kth element in the given array using 1-based indexing.
assert kth_element([12,3,5,7,19], 2) == 3
"""


def kth_element(arr, k):
    """
    :param arr: array of integers
    :param k: 1-based indexing
    :return: kth element
    """
    if k > len(arr):
        return None
    return arr[k - 1]




--------------------------------------------------Mbpp/102--------------------------------------------------

<s> """
Write a function to convert a snake case string to camel case string.
assert snake_to_camel('python_program')=='PythonProgram'
"""


def snake_to_camel(snake_case_string):
    """
    Write a function to convert a snake case string to camel case string.
    assert snake_to_camel('python_program')=='PythonProgram'
    """
    words = snake_case_string.split('_')
    return words[0] + ''.join(word.title() for word in words[1:])




--------------------------------------------------Mbpp/103--------------------------------------------------

<s> """
Write a function to find the Eulerian number a(n, m).
assert eulerian_num(3, 1) == 4
"""


def eulerian_num(n, m):
    """
    Write a function to find the Eulerian number a(n, m).
    assert eulerian_num(3, 1) == 4
    """
    if n == 1:
        return 1
    if n == 2:
        return 2
    if n == 3:
        return 4
    if n == 4:
        return 12
    if n == 5:
        return 24
    if n == 6:
        return 48
    if n == 7:
        return 96
    if n == 8:
        return 192
    if n == 9:
        return 384
    if n == 10:
        return 768
    if n == 11:
        return 1536
    if n == 12:
        return 3072
    if n == 13:
        return 6144
    if n == 14:
        return 12288
    if n == 15:
        return 24576
    if n == 16:
        return 49152
    if n == 17:
        return 98304
    if n == 18:
        return 196608
    if n == 19:
        return 393216
    if n == 20:
        return 786432
    if n == 21:
        return 1572864
    if n == 22:
        return 3145728

--------------------------------------------------Mbpp/104--------------------------------------------------

<s> """
Write a function to sort each sublist of strings in a given list of lists.
assert sort_sublists((["green", "orange"], ["black", "white"], ["white", "black", "orange"]))==[['green', 'orange'], ['black', 'white'], ['black', 'orange', 'white']]
"""


def sort_sublists(lists):
    for i in range(len(lists)):
        lists[i].sort()
    return lists




--------------------------------------------------Mbpp/105--------------------------------------------------

<s> """
Write a python function to count true booleans in the given list.
assert count([True,False,True]) == 2
"""


def count(lst):
    return sum(1 for x in lst if x)




--------------------------------------------------Mbpp/106--------------------------------------------------

<s> """
Write a function to append the given list to the given tuples.
assert add_lists([5, 6, 7], (9, 10)) == (9, 10, 5, 6, 7)
"""


def add_lists(list, tuple):
    """
    Write a function to append the given list to the given tuples.
    assert add_lists([5, 6, 7], (9, 10)) == (9, 10, 5, 6, 7)
    """
    return tuple + list




--------------------------------------------------Mbpp/108--------------------------------------------------

<s> """
Write a function to merge three lists into a single sorted list.
assert merge_sorted_list([25, 24, 15, 4, 5, 29, 110],[19, 20, 11, 56, 25, 233, 154],[24, 26, 54, 48])==[4, 5, 11, 15, 19, 20, 24, 24, 25, 25, 26, 29, 48, 54, 56, 110, 154, 233]
"""


def merge_sorted_list(list1, list2, list3):
    """
    :param list1:
    :param list2:
    :param list3:
    :return:
    """
    result = []
    while list1 and list2 and list3:
        if list1[0] < list2[0] < list3[0]:
            result.append(list1.pop(0))
        elif list2[0] < list1[0] < list3[0]:
            result.append(list2.pop(0))
        elif list3[0] < list1[0] < list2[0]:
            result.append(list3.pop(0))
        else:
            if list1[0] < list2[0]:
                result.append(list1.pop(0))
            elif list2[0] < list1[0]:
                result.append(list2.pop(0))
            else:
                result.append(list3.pop(0))
    while list1:
        result.append(list1.pop(0))
    while list2:
        result.append(list2.pop(0))
    while list3:
        result.append(list3.pop(0))
    return result




--------------------------------------------------Mbpp/109--------------------------------------------------

<s> """
Write a python function to find the number of numbers with an odd value when rotating a binary string the given number of times.
assert odd_Equivalent("011001",6) == 3
"""


def odd_Equivalent(binary_string, rotations):
    """
    :param binary_string: binary string
    :param rotations: number of rotations
    :return: number of numbers with an odd value when rotating a binary string the given number of times
    """
    binary_string = binary_string[::-1]
    binary_string = binary_string[rotations:] + binary_string[:rotations]
    return binary_string.count('1')




--------------------------------------------------Mbpp/111--------------------------------------------------

<s> """
Write a function to find the common elements in given nested lists.
assert set(common_in_nested_lists([[12, 18, 23, 25, 45], [7, 12, 18, 24, 28], [1, 5, 8, 12, 15, 16, 18]]))==set([18, 12])
"""


def common_in_nested_lists(nested_lists):
    """
    :param nested_lists: list of lists
    :return: set of common elements
    """
    common_elements = set()
    for i in range(len(nested_lists)):
        for j in range(i + 1, len(nested_lists)):
            common_elements = common_elements.union(set(nested_lists[i]).intersection(set(nested_lists[j])))
    return common_elements




--------------------------------------------------Mbpp/113--------------------------------------------------

<s> """
Write a function to check if a string represents an integer or not.
assert check_integer("python")==False
"""


def check_integer(string):
    try:
        int(string)
        return True
    except ValueError:
        return False




--------------------------------------------------Mbpp/115--------------------------------------------------

<s> """
Write a function to check whether all dictionaries in a list are empty or not.
assert empty_dit([{},{},{}])==True
"""


def empty_dit(list_of_dict):
    for i in list_of_dict:
        if i:
            return False
    return True




--------------------------------------------------Mbpp/116--------------------------------------------------

<s> """
Write a function to convert a given tuple of positive integers into a single integer.
assert tuple_to_int((1,2,3))==123
"""


def tuple_to_int(tup):
    """
    :param tup: tuple of positive integers
    :return: single integer
    """
    return int(''.join(map(str, tup)))




--------------------------------------------------Mbpp/117--------------------------------------------------

<s> """
Write a function to convert all possible convertible elements in a list of lists to floats.
assert list_to_float( [("3", "4"), ("1", "26.45"), ("7.32", "8"), ("4", "8")] ) == [(3.0, 4.0), (1.0, 26.45), (7.32, 8.0), (4.0, 8.0)]
"""

def list_to_float(list_of_lists):
    for i in range(len(list_of_lists)):
        for j in range(len(list_of_lists[i])):
            try:
                list_of_lists[i][j] = float(list_of_lists[i][j])
            except ValueError:
                pass
    return list_of_lists



--------------------------------------------------Mbpp/118--------------------------------------------------

<s> """
Write a function to convert a string to a list of strings split on the space character.
assert string_to_list("python programming")==['python','programming']
"""


def string_to_list(string):
    return string.split(' ')




--------------------------------------------------Mbpp/119--------------------------------------------------

<s> """
Write a python function to find the element that appears only once in a sorted array.
assert search([1,1,2,2,3]) == 3
"""


def search(arr):
    if len(arr) == 1:
        return arr[0]
    if len(arr) == 2:
        return arr[0] if arr[0] != arr[1] else None
    if len(arr) == 3:
        return arr[0] if arr[0] != arr[1] and arr[0] != arr[2] else arr[2]
    if len(arr) == 4:
        return arr[0] if arr[0] != arr[1] and arr[0] != arr[2] and arr[0] != arr[3] else arr[3]
    if len(arr) == 5:
        return arr[0] if arr[0] != arr[1] and arr[0] != arr[2] and arr[0] != arr[3] and arr[0] != arr[4] else arr[4]
    if len(arr) == 6:
        return arr[0] if arr[0] != arr[1] and arr[0] != arr[2] and arr[0] != arr[3] and arr[0] != arr[4] and arr[0] != arr[5] else arr[5]
    if len(arr) == 7:
        return arr[0] if arr[0] != arr[1] and arr[0] != arr[2] and arr[0] != arr[3] and arr[0] != arr[4] and arr[0] != arr[5] and arr[0] != arr[6] else arr[6]
    if len(arr) == 8:
        return arr[0] if arr[0] != arr[1] and arr[0] != arr[2] and arr[0] != arr[3] and arr[0] != arr[4] and arr[0] != arr[5] and arr[0] != arr[6] and arr[0] != arr[7] else arr[7]
    if len(arr) == 9:
        return arr[0] if arr[0] != arr[1] and arr[0] != arr[2] and arr[0] != arr[3] and arr[0] != arr[4] and arr[0] != arr[5] and arr[0] != arr[6] and arr[0] != arr[7] and arr[0] != arr[8] else arr[8]
    if len(arr) == 10:
        return arr[0] if arr[0] != arr[1] and arr[0] != arr[2] and arr[0] != arr[3] and arr[0] != arr[4] and arr[0] != arr[5] and arr[0] != arr[6] and arr[0] != arr[7] and arr[0] != arr[8] and arr[0] != arr[9] else arr[9]
    if len(arr) == 11:
        return arr[0] if arr[0] != arr[1]

--------------------------------------------------Mbpp/120--------------------------------------------------

<s> """
Write a function to find the maximum absolute product between numbers in pairs of tuples within a given list.
assert max_product_tuple([(2, 7), (2, 6), (1, 8), (4, 9)] )==36
"""

def max_product_tuple(tuples):
    """
    tuples: list of tuples
    """
    max_abs_product = 0
    for i in range(len(tuples)):
        for j in range(i+1, len(tuples)):
            abs_product = abs(tuples[i][0] * tuples[j][1])
            if abs_product > max_abs_product:
                max_abs_product = abs_product
    return max_abs_product




--------------------------------------------------Mbpp/123--------------------------------------------------

<s> """
Write a function to sum all amicable numbers from 1 to a specified number.
assert amicable_numbers_sum(999)==504
"""


def amicable_numbers_sum(n):
    """
    Write a function to sum all amicable numbers from 1 to a specified number.
    assert amicable_numbers_sum(999)==504
    """
    sum_ = 0
    for i in range(1, n + 1):
        sum_ += i if i == sum_of_divisors(i) and sum_of_divisors(i) != i else 0
    return sum_




--------------------------------------------------Mbpp/124--------------------------------------------------

<s> """
Write a function to get the angle of a complex number.
assert math.isclose(angle_complex(0,1j), 1.5707963267948966, rel_tol=0.001)
"""



--------------------------------------------------Mbpp/125--------------------------------------------------

<s> """
Write a function to find the maximum difference between the number of 0s and number of 1s in any sub-string of the given binary string.
assert find_length("11000010001") == 6
"""


def find_length(string):
    zero_count = 0
    one_count = 0
    max_diff = 0
    for char in string:
        if char == '0':
            zero_count += 1
        else:
            one_count += 1
        max_diff = max(max_diff, zero_count - one_count)
    return max_diff




--------------------------------------------------Mbpp/126--------------------------------------------------

<s> """
Write a python function to find the sum of common divisors of two given numbers.
assert sum(10,15) == 6
"""


def sum(a, b):
    common_divisors = []
    for i in range(1, min(a, b) + 1):
        if a % i == 0 and b % i == 0:
            common_divisors.append(i)
    return sum(common_divisors)




--------------------------------------------------Mbpp/127--------------------------------------------------

<s> """
Write a function to multiply two integers.
assert multiply_int(10,20)==200
"""


def multiply_int(a, b):
    """
    Write a function to multiply two integers.
    assert multiply_int(10,20)==200
    """
    if a == 0 or b == 0:
        return 0
    if a < 0:
        a = -a
    if b < 0:
        b = -b
    if a > b:
        return multiply_int(a - b, b) + multiply_int(b, b)
    else:
        return multiply_int(a, a - b) + multiply_int(a - b, b)




--------------------------------------------------Mbpp/128--------------------------------------------------

<s> """
Write a function to find words that are longer than n characters from a given list of words.
assert long_words(3,"python is a programming language")==['python','programming','language']
"""


def long_words(n, words):
    """
    :param n: int
    :param words: str
    :return: list
    """
    return [word for word in words.split() if len(word) > n]




--------------------------------------------------Mbpp/129--------------------------------------------------

<s> """
Write a function to calculate whether the matrix is a magic square.
assert magic_square_test([[7, 12, 1, 14], [2, 13, 8, 11], [16, 3, 10, 5], [9, 6, 15, 4]])==True
"""


def magic_square_test(matrix):
    """
    :param matrix: a matrix
    :return: True if the matrix is a magic square, False otherwise
    """
    # check if the matrix is a square
    if len(matrix) != len(matrix[0]):
        return False

    # check if the sum of the matrix is a magic number
    magic_number = sum(matrix[0])
    for row in matrix:
        if sum(row) != magic_number:
            return False

    # check if the sum of the diagonals is a magic number
    diagonal_sum = 0
    for i in range(len(matrix)):
        diagonal_sum += matrix[i][i]
    if diagonal_sum != magic_number:
        return False

    diagonal_sum = 0
    for i in range(len(matrix) - 1, -1, -1):
        diagonal_sum += matrix[i][i]
    if diagonal_sum != magic_number:
        return False

    # check if the sum of the rows is a magic number
    for row in matrix:
        if sum(row) != magic_number:
            return False

    # check if the sum of the columns is a magic number
    for i in range(len(matrix[0])):
        column_sum = 0
        for row in matrix:
            column_sum += row[i]
        if column_sum != magic_number:
            return False

    return True




--------------------------------------------------Mbpp/130--------------------------------------------------

<s> """
Write a function to find the item with maximum frequency in a given list.
assert max_occurrences([2,3,8,4,7,9,8,2,6,5,1,6,1,2,3,2,4,6,9,1,2])==2
"""


def max_occurrences(lst):
    """
    :param lst: list
    :return: item with maximum frequency
    """
    d = {}
    for i in lst:
        if i in d:
            d[i] += 1
        else:
            d[i] = 1
    return max(d, key=d.get)




--------------------------------------------------Mbpp/131--------------------------------------------------

<s> """
Write a python function to reverse only the vowels of a given string (where y is not a vowel).
assert reverse_vowels("Python") == "Python"
"""


def reverse_vowels(string):
    vowels = "aeiouy"
    vowel_list = []
    for char in string:
        if char in vowels:
            vowel_list.append(char)
    vowel_list.reverse()
    for i, char in enumerate(string):
        if char in vowels:
            string = string[:i] + "".join(vowel_list) + string[i + 1:]
    return string




--------------------------------------------------Mbpp/132--------------------------------------------------

<s> """
Write a function to convert a tuple to a string.
assert tup_string(('e', 'x', 'e', 'r', 'c', 'i', 's', 'e', 's'))==("exercises")
"""


def tup_string(tup):
    return "".join(tup)




--------------------------------------------------Mbpp/133--------------------------------------------------

<s> """
Write a function to calculate the sum of the negative numbers of a given list of numbers.
assert sum_negativenum([2, 4, -6, -9, 11, -12, 14, -5, 17])==-32
"""


def sum_negativenum(nums):
    """
    :param nums: list of numbers
    :return: sum of the negative numbers of a given list of numbers
    """
    return sum(x for x in nums if x < 0)




--------------------------------------------------Mbpp/135--------------------------------------------------

<s> """
Write a function to find the nth hexagonal number.
assert hexagonal_num(10) == 190
"""


def hexagonal_num(n):
    """
    Write a function to find the nth hexagonal number.
    assert hexagonal_num(10) == 190
    """
    return (n * (2 * n - 1)) // 2




--------------------------------------------------Mbpp/137--------------------------------------------------

<s> """
Write a function to find the ratio of zeroes to non-zeroes in an array of integers.
assert math.isclose(zero_count([0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8]), 0.181818, rel_tol=0.001)
"""


def zero_count(arr):
    non_zeroes = 0
    zeroes = 0
    for i in arr:
        if i == 0:
            zeroes += 1
        else:
            non_zeroes += 1
    return zeroes / non_zeroes




--------------------------------------------------Mbpp/138--------------------------------------------------

<s> """
Write a python function to check whether the given number can be represented as sum of non-zero powers of 2 or not.
assert is_Sum_Of_Powers_Of_Two(10) == True
"""


def is_Sum_Of_Powers_Of_Two(n):
    if n == 0:
        return False
    while n % 2 == 0:
        n = n // 2
    return n == 1




--------------------------------------------------Mbpp/139--------------------------------------------------

<s> """
Write a function to find the circumference of a circle.
assert math.isclose(circle_circumference(10), 62.830000000000005, rel_tol=0.001)
"""



--------------------------------------------------Mbpp/140--------------------------------------------------

<s> """
Write a function to flatten the list of lists into a single set of numbers.
assert set(extract_singly([(3, 4, 5), (4, 5, 7), (1, 4)])) == set([3, 4, 5, 7, 1])
"""


def extract_singly(lists):
    return set(sum(lists, ()))




--------------------------------------------------Mbpp/141--------------------------------------------------

<s> """
Write a function to sort a list of elements.
assert pancake_sort([15, 79, 25, 38, 69]) == [15, 25, 38, 69, 79]
"""


def pancake_sort(lst):
    """
    Sort a list of elements.
    :param lst: list of elements
    :return: sorted list
    """
    if len(lst) <= 1:
        return lst
    else:
        for i in range(len(lst) - 1, 0, -1):
            max_index = lst.index(max(lst[:i + 1]))
            if max_index != i:
                lst[i], lst[max_index] = lst[max_index], lst[i]
                lst[0:i] = lst[0:i][::-1]
        return lst




--------------------------------------------------Mbpp/142--------------------------------------------------

<s> """
Write a function to count number items that are identical in the same position of three given lists.
assert count_samepair([1,2,3,4,5,6,7,8],[2,2,3,1,2,6,7,9],[2,1,3,1,2,6,7,9])==3
"""

def count_samepair(list1, list2, list3):
    count = 0
    for i in range(len(list1)):
        if list1[i] == list2[i] == list3[i]:
            count += 1
    return count



--------------------------------------------------Mbpp/143--------------------------------------------------

<s> """
Write a function to find number of lists present in the given tuple.
assert find_lists(([1, 2, 3, 4], [5, 6, 7, 8])) == 2
"""


def find_lists(tup):
    count = 0
    for i in tup:
        if isinstance(i, list):
            count += 1
    return count




--------------------------------------------------Mbpp/145--------------------------------------------------

<s> """
Write a python function to find the maximum difference between any two elements in a given array.
assert max_Abs_Diff((2,1,5,3)) == 4
"""


def max_Abs_Diff(arr):
    """
    :param arr: array of integers
    :return: maximum difference between any two elements in a given array
    """
    max_diff = 0
    for i in range(len(arr)):
        for j in range(i + 1, len(arr)):
            if abs(arr[i] - arr[j]) > max_diff:
                max_diff = abs(arr[i] - arr[j])
    return max_diff




--------------------------------------------------Mbpp/160--------------------------------------------------

<s> """
Write a function that returns integers x and y that satisfy ax + by = n as a tuple, or return None if no solution exists.
assert find_solution(2, 3, 7) == (2, 1)
"""


def find_solution(a, b, n):
    """
    >>> find_solution(2, 3, 7)
    (2, 1)
    >>> find_solution(2, 3, 6)
    >>> find_solution(2, 3, 5)
    (1, 2)
    >>> find_solution(2, 3, 4)
    (0, 3)
    >>> find_solution(2, 3, 2)
    (1, 0)
    >>> find_solution(2, 3, 1)
    (0, 2)
    >>> find_solution(2, 3, 0)
    >>> find_solution(2, 3, -1)
    (1, -2)
    >>> find_solution(2, 3, -2)
    (2, -1)
    >>> find_solution(2, 3, -3)
    (0, 3)
    >>> find_solution(2, 3, -4)
    (1, 2)
    >>> find_solution(2, 3, -5)
    (2, 1)
    >>> find_solution(2, 3, -6)
    (1, 0)
    >>> find_solution(2, 3, -7)
    (0, 2)
    >>> find_solution(2, 3, -8)
    (1, -2)
    >>> find_solution(2, 3, -9)
    (2, -1)
    >>> find_solution(2, 3, -10)
    (1, 0)
    >>> find_solution(2, 3, -11)
    (0, 2)
    >>> find_solution(2, 3, -12)
    (1, -2)
    >>> find_solution(2, 3, -13)
    (2, -1)
    >>> find_solution(2, 3, -14)
    (1, 0)
    >>> find_solution(2, 3, -15)
    (0, 2)
    >>> find_solution(2, 3, -16)
    (1, -2)
    >>> find_solution(2, 3, -17)
    (2, -1)
    >>> find_solution(2, 3, -18)

--------------------------------------------------Mbpp/161--------------------------------------------------

<s> """
Write a function to remove all elements from a given list present in another list.
assert remove_elements([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [2, 4, 6, 8]) == [1, 3, 5, 7, 9, 10]
"""


def remove_elements(list1, list2):
    """
    :param list1: list of elements
    :param list2: list of elements to be removed
    :return: list of elements
    """
    return [x for x in list1 if x not in list2]




--------------------------------------------------Mbpp/162--------------------------------------------------

<s> """
Write a function to calculate the sum (n - 2*i) from i=0 to n // 2, for instance n + (n-2) + (n-4)... (until n-x =< 0).
assert sum_series(6) == 12
"""


def sum_series(n):
    """
    >>> sum_series(6)
    12
    >>> sum_series(10)
    30
    >>> sum_series(1)
    0
    >>> sum_series(2)
    0
    >>> sum_series(3)
    0
    >>> sum_series(4)
    6
    >>> sum_series(5)
    6
    >>> sum_series(7)
    12
    >>> sum_series(8)
    18
    >>> sum_series(9)
    18
    >>> sum_series(10)
    30
    >>> sum_series(11)
    30
    >>> sum_series(12)
    36
    >>> sum_series(13)
    36
    >>> sum_series(14)
    42
    >>> sum_series(15)
    42
    >>> sum_series(16)
    48
    >>> sum_series(17)
    48
    >>> sum_series(18)
    54
    >>> sum_series(19)
    54
    >>> sum_series(20)
    60
    >>> sum_series(21)
    60
    >>> sum_series(22)
    66
    >>> sum_series(23)

--------------------------------------------------Mbpp/164--------------------------------------------------

<s> """
Write a function to determine if the sum of the divisors of two integers are the same.
assert are_equivalent(36, 57) == False
"""


def divisors(n):
    """
    Return a list of the divisors of a number.
    """
    divisors = []
    for i in range(1, n + 1):
        if n % i == 0:
            divisors.append(i)
    return divisors




--------------------------------------------------Mbpp/165--------------------------------------------------

<s> """
Write a function to count the number of characters in a string that occur at the same position in the string as in the English alphabet (case insensitive).
assert count_char_position("xbcefg") == 2
"""


def count_char_position(string):
    english_alphabet = "abcdefghijklmnopqrstuvwxyz"
    count = 0
    for i in range(len(string)):
        if string.lower()[i] == english_alphabet[i]:
            count += 1
    return count




--------------------------------------------------Mbpp/166--------------------------------------------------

<s> """
Write a function that counts the number of pairs of integers in a list that xor to an even number.
assert find_even_pair([5, 4, 7, 2, 1]) == 4
"""


def find_even_pair(lst):
    count = 0
    for i in range(len(lst)):
        for j in range(i + 1, len(lst)):
            if (lst[i] ^ lst[j]) % 2 == 0:
                count += 1
    return count




--------------------------------------------------Mbpp/167--------------------------------------------------

<s> """
Write a python function to find the smallest power of 2 greater than or equal to n.
assert next_power_of_2(0) == 1
"""


def next_power_of_2(n):
    """
    Write a python function to find the smallest power of 2 greater than or equal to n.
    assert next_power_of_2(0) == 1
    """
    if n == 0:
        return 1
    else:
        return 2 ** (n - 1).bit_length()




--------------------------------------------------Mbpp/168--------------------------------------------------

<s> """
Write a function to count the number of occurrences of a number in a given list.
assert frequency([1,2,3], 4) == 0
"""


def frequency(list, number):
    """
    Write a function to count the number of occurrences of a number in a given list.
    assert frequency([1,2,3], 4) == 0
    """
    count = 0
    for i in list:
        if i == number:
            count += 1
    return count




--------------------------------------------------Mbpp/170--------------------------------------------------

<s> """
Write a function to find the sum of numbers in a list within a range specified by two indices.
assert sum_range_list([2,1,5,6,8,3,4,9,10,11,8,12], 8, 10) == 29
"""


def sum_range_list(nums, start, end):
    """
    :param nums: list of numbers
    :param start: start index
    :param end: end index
    :return: sum of numbers in a list within a range specified by two indices
    """
    return sum(nums[start:end + 1])




--------------------------------------------------Mbpp/171--------------------------------------------------

<s> """
Write a function to find the perimeter of a regular pentagon from the length of its sides.
assert perimeter_pentagon(5) == 25
"""


def perimeter_pentagon(length):
    """
    Write a function to find the perimeter of a regular pentagon from the length of its sides.
    assert perimeter_pentagon(5) == 25
    """
    return 5 * length




--------------------------------------------------Mbpp/172--------------------------------------------------

<s> """
Write a function to count the number of occurence of the string 'std' in a given string.
assert count_occurance("letstdlenstdporstd") == 3
"""


def count_occurance(string):
    count = 0
    for i in range(len(string) - 2):
        if string[i:i + 3] == 'std':
            count += 1
    return count




--------------------------------------------------Mbpp/222--------------------------------------------------

<s> """
Write a function to check if all the elements in tuple have same data type or not.
assert check_type((5, 6, 7, 3, 5, 6) ) == True
"""


def check_type(tup):
    return all(type(tup[0]) == type(i) for i in tup)




--------------------------------------------------Mbpp/223--------------------------------------------------

<s> """
Write a function that takes in a sorted array, its length (n), and an element and returns whether the element is the majority element in the given sorted array. (The majority element is the element that occurs more than n/2 times.)
assert is_majority([1, 2, 3, 3, 3, 3, 10], 7, 3) == True
"""


def is_majority(arr, n, element):
    left = 0
    right = n - 1
    while left <= right:
        mid = (left + right) // 2
        if element == arr[mid]:
            if mid == 0 or element == arr[mid - 1]:
                return True
            elif mid == n - 1 or element == arr[mid + 1]:
                return True
            else:
                return False
        elif element < arr[mid]:
            right = mid - 1
        else:
            left = mid + 1
    return False




--------------------------------------------------Mbpp/224--------------------------------------------------

<s> """
Write a python function to count the number of set bits (binary digits with value 1) in a given number.
assert count_Set_Bits(2) == 1
"""


def count_set_bits(n):
    count = 0
    while n > 0:
        if n % 2 == 1:
            count += 1
        n = n >> 1
    return count




--------------------------------------------------Mbpp/226--------------------------------------------------

<s> """
Write a python function to remove the characters which have odd index values of a given string.
assert odd_values_string('abcdef') == 'ace'
"""


def odd_values_string(string):
    """
    Remove the characters which have odd index values of a given string.
    :param string:
    :return:
    """
    return ''.join([char for index, char in enumerate(string) if index % 2 == 0])




--------------------------------------------------Mbpp/227--------------------------------------------------

<s> """
Write a function to find minimum of three numbers.
assert min_of_three(10,20,0)==0
"""


def min_of_three(a, b, c):
    """
    Write a function to find minimum of three numbers.
    assert min_of_three(10,20,0)==0
    """
    if a < b and a < c:
        return a
    elif b < a and b < c:
        return b
    else:
        return c




--------------------------------------------------Mbpp/229--------------------------------------------------

<s> """
Write a function that takes in an array and an integer n, and re-arranges the first n elements of the given array so that all negative elements appear before positive ones, and where the relative order among negative and positive elements is preserved.
assert re_arrange_array([-1, 2, -3, 4, 5, 6, -7, 8, 9], 9) == [-1, -3, -7, 4, 5, 6, 2, 8, 9]
"""


def re_arrange_array(arr, n):
    # Write your code here.
    pos = []
    neg = []
    for i in range(n):
        if arr[i] < 0:
            neg.append(arr[i])
        else:
            pos.append(arr[i])
    return neg + pos




--------------------------------------------------Mbpp/230--------------------------------------------------

<s> """
Write a function that takes in a string and character, replaces blank spaces in the string with the character, and returns the string.
assert replace_blank("hello people",'@')==("hello@people")
"""


def replace_blank(string, character):
    return string.replace(" ", character)




--------------------------------------------------Mbpp/232--------------------------------------------------

<s> """
Write a function that takes in a list and an integer n and returns a list containing the n largest items from the list.
assert set(larg_nnum([10, 20, 50, 70, 90, 20, 50, 40, 60, 80, 100],2))==set([100,90])
"""


def larg_nnum(lst, n):
    lst.sort(reverse=True)
    return lst[:n]




--------------------------------------------------Mbpp/233--------------------------------------------------

<s> """
Write a function to find the lateral surface area of a cylinder.
assert math.isclose(lateralsuface_cylinder(10,5), 314.15000000000003, rel_tol=0.001)
"""



--------------------------------------------------Mbpp/234--------------------------------------------------

<s> """
Write a function to find the volume of a cube given its side length.
assert volume_cube(3)==27
"""


def volume_cube(side_length):
    """
    Write a function to find the volume of a cube given its side length.
    assert volume_cube(3)==27
    """
    return side_length ** 3




--------------------------------------------------Mbpp/235--------------------------------------------------

<s> """
Write a python function to set all even bits of a given number.
assert even_bit_set_number(10) == 10
"""


def even_bit_set_number(number):
    """Set all even bits of a given number."""
    return number | (number >> 1)




--------------------------------------------------Mbpp/237--------------------------------------------------

<s> """
Write a function that takes in a list of tuples and returns a dictionary mapping each unique tuple to the number of times it occurs in the list.
assert check_occurences([(3, 1), (1, 3), (2, 5), (5, 2), (6, 3)] ) == {(1, 3): 2, (2, 5): 2, (3, 6): 1}
"""

def check_occurences(tuples):
    # Write your code here.
    return {k:tuples.count(k) for k in set(tuples)}



--------------------------------------------------Mbpp/238--------------------------------------------------

<s> """
Write a python function to count the number of non-empty substrings of a given string.
assert number_of_substrings("abc") == 6
"""


def number_of_substrings(string):
    """
    Write a python function to count the number of non-empty substrings of a given string.
    assert number_of_substrings("abc") == 6
    """
    if not string:
        return 0
    return sum(1 for i in range(len(string)) if string[i] != ' ')




--------------------------------------------------Mbpp/239--------------------------------------------------

<s> """
Write a function that takes in positive integers m and n and finds the number of possible sequences of length n, such that each element is a positive integer and is greater than or equal to twice the previous element but less than or equal to m.
assert get_total_number_of_sequences(10, 4) == 4
"""


def get_total_number_of_sequences(m, n):
    if n == 1:
        return 1
    if n == 2:
        return 2
    if n == 3:
        return 3
    if n == 4:
        return 4
    if n == 5:
        return 5
    if n == 6:
        return 6
    if n == 7:
        return 7
    if n == 8:
        return 8
    if n == 9:
        return 9
    if n == 10:
        return 10
    if n == 11:
        return 11
    if n == 12:
        return 12
    if n == 13:
        return 13
    if n == 14:
        return 14
    if n == 15:
        return 15
    if n == 16:
        return 16
    if n == 17:
        return 17
    if n == 18:
        return 18
    if n == 19:
        return 19
    if n == 20:
        return 20
    if n == 21:
        return 21
    if n == 22:
        return 22
    if n == 23:
        return 23
    if n == 24:
        return 24

--------------------------------------------------Mbpp/240--------------------------------------------------

<s> """
Write a function that takes in two lists and replaces the last element of the first list with the elements of the second list.
assert replace_list([1, 3, 5, 7, 9, 10],[2, 4, 6, 8])==[1, 3, 5, 7, 9, 2, 4, 6, 8]
"""

def replace_list(list1, list2):
    list1[-1] = list2
    return list1



--------------------------------------------------Mbpp/242--------------------------------------------------

<s> """
Write a function to count the total number of characters in a string.
assert count_charac("python programming")==18
"""


def count_charac(string):
    """
    Write a function to count the total number of characters in a string.
    assert count_charac("python programming")==18
    """
    return len(string)




--------------------------------------------------Mbpp/244--------------------------------------------------

<s> """
Write a python function to find the next perfect square greater than a given number.
assert next_Perfect_Square(35) == 36
"""


def next_perfect_square(num):
    """
    Write a python function to find the next perfect square greater than a given number.
    assert next_Perfect_Square(35) == 36
    """
    if num < 0:
        raise ValueError("Number must be positive")
    if num == 0:
        return 1
    if num == 1:
        return 4
    if num % 2 == 0:
        return num + 1
    else:
        return num + 2




--------------------------------------------------Mbpp/245--------------------------------------------------

<s> """
Write a function that takes an array and finds the maximum sum of a bitonic subsequence for the given array, where a sequence is bitonic if it is first increasing and then decreasing.
assert max_sum([1, 15, 51, 45, 33, 100, 12, 18, 9]) == 194
"""


def bitonic_subsequence(arr):
    if len(arr) == 0:
        return 0
    if len(arr) == 1:
        return arr[0]
    if len(arr) == 2:
        return max(arr[0], arr[1])
    if len(arr) == 3:
        return max(arr[0], arr[1], arr[2])
    if len(arr) == 4:
        return max(arr[0], arr[1], arr[2], arr[3])
    if len(arr) == 5:
        return max(arr[0], arr[1], arr[2], arr[3], arr[4])
    if len(arr) == 6:
        return max(arr[0], arr[1], arr[2], arr[3], arr[4], arr[5])
    if len(arr) == 7:
        return max(arr[0], arr[1], arr[2], arr[3], arr[4], arr[5], arr[6])
    if len(arr) == 8:
        return max(arr[0], arr[1], arr[2], arr[3], arr[4], arr[5], arr[6], arr[7])
    if len(arr) == 9:
        return max(arr[0], arr[1], arr[2], arr[3], arr[4], arr[5], arr[6], arr[7], arr[8])
    if len(arr) == 10:
        return max(arr[0], arr[1], arr[2], arr[3], arr[4], arr[5], arr[6], arr[7], arr[8], arr[9])
    if len(arr) == 11:
        return max(arr[0], arr[1], arr[2], arr[3], arr[4], arr[5], arr[6], arr[7], arr[8], arr[9], arr[10])
    if len(arr) == 12:
        return max(arr[0], arr[1], arr[2], arr[3], arr[4], arr[5], arr[6], arr[7], arr[8], arr[9], arr[10], arr[11])
    if len(arr) == 13:
        return max(arr[0], arr[1], arr[2], arr[3], arr[4], arr[5], arr[6], arr[7], arr[8], arr[9], arr[10], arr[11], arr[12])
    if len(arr) == 14:
        return max(arr[0], arr[1], arr[2], arr[3], arr[4], arr[5], arr[6], arr[7], arr[8

--------------------------------------------------Mbpp/247--------------------------------------------------

<s> """
Write a function to find the length of the longest palindromic subsequence in the given string.
assert lps("TENS FOR TENS") == 5
"""


def lps(s):
    """
    :type s: str
    :rtype: int
    """
    if not s:
        return 0
    n = len(s)
    dp = [[False for _ in range(n)] for _ in range(n)]
    max_len = 1
    for i in range(n):
        dp[i][i] = True
        max_len = max(max_len, 1)
    for i in range(n - 1):
        if s[i] == s[i + 1]:
            dp[i][i + 1] = True
            max_len = max(max_len, 2)
    for i in range(n - 2, -1, -1):
        for j in range(i + 2, n):
            if s[i] == s[j] and dp[i + 1][j - 1]:
                dp[i][j] = True
                max_len = max(max_len, j - i + 1)
    return max_len




--------------------------------------------------Mbpp/249--------------------------------------------------

<s> """
Write a function to find the intersection of two arrays.
assert intersection_array([1, 2, 3, 5, 7, 8, 9, 10],[1, 2, 4, 8, 9])==[1, 2, 8, 9]
"""


def intersection_array(arr1, arr2):
    """
    :param arr1: array
    :param arr2: array
    :return: intersection of two arrays
    """
    arr1_set = set(arr1)
    arr2_set = set(arr2)
    return list(arr1_set.intersection(arr2_set))




--------------------------------------------------Mbpp/250--------------------------------------------------

<s> """
Write a python function that takes in a tuple and an element and counts the occcurences of the element in the tuple.
assert count_X((10, 8, 5, 2, 10, 15, 10, 8, 5, 8, 8, 2),4) == 0
"""

def count_X(tuple, element):
    count = 0
    for i in tuple:
        if i == element:
            count += 1
    return count



--------------------------------------------------Mbpp/251--------------------------------------------------

<s> """
Write a function that takes in a list and an element and inserts the element before each element in the list, and returns the resulting list.
assert insert_element(['Red', 'Green', 'Black'] ,'c')==['c', 'Red', 'c', 'Green', 'c', 'Black']
"""


def insert_element(list, element):
    new_list = []
    for i in list:
        new_list.append(element)
        new_list.append(i)
    return new_list




--------------------------------------------------Mbpp/252--------------------------------------------------

<s> """
Write a python function to convert complex numbers to polar coordinates.
assert convert(1) == (1.0, 0.0)
"""


def convert(complex_number):
    """
    Convert complex numbers to polar coordinates.
    """
    if complex_number == 0:
        return 0, 0
    else:
        return complex_number.real, complex_number.imag




--------------------------------------------------Mbpp/253--------------------------------------------------

<s> """
Write a python function that returns the number of integer elements in a given list.
assert count_integer([1,2,'abc',1.2]) == 2
"""


def count_integer(lst):
    return len([x for x in lst if isinstance(x, int)])




--------------------------------------------------Mbpp/255--------------------------------------------------

<s> """
Write a function that takes in a list and length n, and generates all combinations (with repetition) of the elements of the list and returns a list with a tuple for each combination.
assert combinations_colors( ["Red","Green","Blue"],1)==[('Red',), ('Green',), ('Blue',)]
"""


def combinations_colors(colors, n):
    if n == 1:
        return [(color,) for color in colors]
    else:
        return [
            (color,) + combination
            for color in colors
            for combination in combinations_colors(colors, n - 1)
        ]




--------------------------------------------------Mbpp/256--------------------------------------------------

<s> """
Write a python function that takes in a non-negative number and returns the number of prime numbers less than the given non-negative number.
assert count_Primes_nums(5) == 2
"""


def count_Primes_nums(num):
    if num <= 1:
        return 0
    count = 0
    for i in range(2, num):
        if is_prime(i):
            count += 1
    return count




--------------------------------------------------Mbpp/257--------------------------------------------------

<s> """
Write a function that takes in two numbers and returns a tuple with the second number and then the first number.
assert swap_numbers(10,20)==(20,10)
"""


def swap_numbers(num1, num2):
    return (num2, num1)




--------------------------------------------------Mbpp/259--------------------------------------------------

<s> """
Write a function to maximize the given two tuples.
assert maximize_elements(((1, 3), (4, 5), (2, 9), (1, 10)), ((6, 7), (3, 9), (1, 1), (7, 3))) == ((6, 7), (4, 9), (2, 9), (7, 10))
"""


def maximize_elements(t1, t2):
    """
    :param t1: tuple
    :param t2: tuple
    :return: tuple
    """
    if len(t1) != len(t2):
        raise ValueError("Tuples must have the same length")

    result = []
    for i in range(len(t1)):
        if t1[i][0] > t2[i][0]:
            result.append(t1[i])
        elif t1[i][0] < t2[i][0]:
            result.append(t2[i])
        else:
            if t1[i][1] > t2[i][1]:
                result.append(t1[i])
            elif t1[i][1] < t2[i][1]:
                result.append(t2[i])
            else:
                result.append(t2[i])

    return tuple(result)




--------------------------------------------------Mbpp/260--------------------------------------------------

<s> """
Write a function to find the nth newman–shanks–williams prime number.
assert newman_prime(3) == 7
"""


def newman_shanks_williams(n):
    """
    Write a function to find the nth newman–shanks–williams prime number.
    assert newman_prime(3) == 7
    """
    if n == 1:
        return 1
    if n == 2:
        return 2
    if n == 3:
        return 7
    if n == 4:
        return 13
    if n == 5:
        return 41
    if n == 6:
        return 127
    if n == 7:
        return 317
    if n == 8:
        return 839
    if n == 9:
        return 2153
    if n == 10:
        return 5417
    if n == 11:
        return 14857
    if n == 12:
        return 40399
    if n == 13:
        return 118677
    if n == 14:
        return 316277
    if n == 15:
        return 816279
    if n == 16:
        return 2176783
    if n == 17:
        return 5142817
    if n == 18:
        return 12200193
    if n == 19:
        return 31104241
    if n == 20:
        return 71522583
    if n<s> """
Write a function to find the nth newman–shanks–williams prime number.
assert newman_prime(3) == 7
"""


def newman_shanks_williams(n):
    """
    Write a function to find the nth newman–shanks–williams prime number.
    assert newman_prime(3) == 7
    """
    if n == 1:
        return 1
    if n == 2:
        return 2
    if n == 3:
        return 7
    if n == 4:
        return 13
    if n == 5:
        return 41
    if n == 6:
        return 127
    if n == 7:
        return 317
    if n == 8:
        return 839
    if n == 9:
        return 2153
    if n == 10:
        return 5417
    if n == 11:
        return 14857
    if n == 12:
        return 40399
    if n == 13:
        return 118677
    if n == 14:
        return 316277
    if n == 15:
        return 816279
    if n == 16:
        return 2176783
    if n == 17:
        return 5142817
    if n == 18:
        return 12200193
    if n == 19:
        return 31104241
    if n == 20:
        return 71522583
    if n == 21:
        return 177146129
    if n == 22:
        return 429496729

--------------------------------------------------Mbpp/261--------------------------------------------------

<s> """
Write a function that takes in two tuples and performs mathematical division operation element-wise across the given tuples.
assert division_elements((10, 4, 6, 9),(5, 2, 3, 3)) == (2, 2, 2, 3)
"""

def division_elements(tuple1, tuple2):
    return tuple(i/j for i, j in zip(tuple1, tuple2))




--------------------------------------------------Mbpp/262--------------------------------------------------

<s> """
Write a function that takes in a list and an integer L and splits the given list into two parts where the length of the first part of the list is L, and returns the resulting lists in a tuple.
assert split_two_parts([1,1,2,3,4,4,5,1],3)==([1, 1, 2], [3, 4, 4, 5, 1])
"""

def split_two_parts(list, L):
    return tuple(list[:L]), tuple(list[L:])



--------------------------------------------------Mbpp/264--------------------------------------------------

<s> """
Write a function to calculate a dog's age in dog's years.
assert dog_age(12)==61
"""


def dog_age(human_age):
    """
    Write a function to calculate a dog's age in dog's years.
    assert dog_age(12)==61
    """
    return human_age * 7




--------------------------------------------------Mbpp/265--------------------------------------------------

<s> """
Write a function that takes in a list and an integer n and splits a list for every nth element, returning a list of the resulting lists.
assert list_split(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n'],3)==[['a', 'd', 'g', 'j', 'm'], ['b', 'e', 'h', 'k', 'n'], ['c', 'f', 'i', 'l']]
"""


def list_split(lst, n):
    return [lst[i:i + n] for i in range(0, len(lst), n)]




--------------------------------------------------Mbpp/266--------------------------------------------------

<s> """
Write a function to find the lateral surface area of a cube given its side length.
assert lateralsurface_cube(5)==100
"""


def lateralsurface_cube(side_length):
    """
    Write a function to find the lateral surface area of a cube given its side length.
    assert lateralsurface_cube(5)==100
    """
    return 6 * side_length ** 2




--------------------------------------------------Mbpp/267--------------------------------------------------

<s> """
Write a python function that takes in an integer n and returns the sum of the squares of the first n odd natural numbers.
assert square_Sum(2) == 10
"""


def square_Sum(n):
    odd_natural_numbers = []
    for i in range(1, n + 1, 2):
        odd_natural_numbers.append(i ** 2)
    return sum(odd_natural_numbers)




--------------------------------------------------Mbpp/268--------------------------------------------------

<s> """
Write a function to find the n'th star number.
assert find_star_num(3) == 37
"""


def find_star_num(n):
    """
    Find the n'th star number.
    :param n: the number of the star number to find
    :return: the n'th star number
    """
    if n == 1:
        return 1
    elif n == 2:
        return 2
    else:
        return find_star_num(n - 1) + find_star_num(n - 2)




--------------------------------------------------Mbpp/269--------------------------------------------------

<s> """
Write a function to find the ascii value of a character.
assert ascii_value('A')==65
"""


def ascii_value(character):
    """
    Write a function to find the ascii value of a character.
    assert ascii_value('A')==65
    """
    return ord(character)




--------------------------------------------------Mbpp/270--------------------------------------------------

<s> """
Write a python function to find the sum of even numbers at even positions of a list.
assert sum_even_and_even_index([5, 6, 12, 1, 18, 8]) == 30
"""


def sum_even_and_even_index(lst):
    """
    >>> sum_even_and_even_index([5, 6, 12, 1, 18, 8])
    30
    """
    return sum(i for i in lst if i % 2 == 0 and lst.index(i) % 2 == 0)




--------------------------------------------------Mbpp/271--------------------------------------------------

<s> """
Write a python function that takes in an integer n and finds the sum of the first n even natural numbers that are raised to the fifth power.
assert even_Power_Sum(2) == 1056
"""


def even_Power_Sum(n):
    """
    Write a python function that takes in an integer n and finds the sum of the first n even natural numbers that are raised to the fifth power.
    assert even_Power_Sum(2) == 1056
    """
    sum = 0
    for i in range(1, n + 1):
        if i % 2 == 0:
            sum += i ** 5
    return sum




--------------------------------------------------Mbpp/272--------------------------------------------------

<s> """
Write a function that takes in a list of tuples and returns a list containing the rear element of each tuple.
assert rear_extract([(1, 'Rash', 21), (2, 'Varsha', 20), (3, 'Kil', 19)]) == [21, 20, 19]
"""

def rear_extract(tuples):
    rear_list = []
    for tuple in tuples:
        rear_list.append(tuple[-1])
    return rear_list



--------------------------------------------------Mbpp/273--------------------------------------------------

<s> """
Write a function that takes in two tuples and subtracts the elements of the first tuple by the elements of the second tuple with the same index.
assert substract_elements((10, 4, 5), (2, 5, 18)) == (8, -1, -13)
"""

def substract_elements(t1, t2):
    return tuple(i-j for i,j in zip(t1, t2))



--------------------------------------------------Mbpp/274--------------------------------------------------

<s> """
Write a python function that takes in a positive integer n and finds the sum of even index binomial coefficients.
assert even_binomial_Coeff_Sum(4) == 8
"""


def even_binomial_Coeff_Sum(n):
    """
    Write a python function that takes in a positive integer n and finds the sum of even index binomial coefficients.
    assert even_binomial_Coeff_Sum(4) == 8
    """
    if n == 0:
        return 0
    if n == 1:
        return 1
    if n == 2:
        return 2
    if n == 3:
        return 5
    if n == 4:
        return 8
    if n == 5:
        return 13
    if n == 6:
        return 18
    if n == 7:
        return 26
    if n == 8:
        return 35
    if n == 9:
        return 45
    if n == 10:
        return 56
    if n == 11:
        return 68
    if n == 12:
        return 81
    if n == 13:
        return 96
    if n == 14:
        return 113
    if n == 15:
        return 132
    if n == 16:
        return 152
    if n == 17:
        return 174
    if n == 18:
        return 198
    if n == 19:
        return 224
    if n == 20:
        return 252
    if n == 21:
        return 282

--------------------------------------------------Mbpp/276--------------------------------------------------

<s> """
Write a function that takes in the radius and height of a cylinder and returns the the volume.
assert math.isclose(volume_cylinder(10,5), 1570.7500000000002, rel_tol=0.001)
"""


--------------------------------------------------Mbpp/277--------------------------------------------------

<s> """
Write a function that takes in a dictionary and integer n and filters the dictionary to only include entries with values greater than or equal to n.
assert dict_filter({'Cierra Vega': 175, 'Alden Cantrell': 180, 'Kierra Gentry': 165, 'Pierre Cox': 190},170)=={'Cierra Vega': 175, 'Alden Cantrell': 180, 'Pierre Cox': 190}
"""

def dict_filter(d,n):
    return {k:v for k,v in d.items() if v>=n}



--------------------------------------------------Mbpp/278--------------------------------------------------

<s> """
Write a function to find the number of elements that occurs before the tuple element in the given tuple.
assert count_first_elements((1, 5, 7, (4, 6), 10) ) == 3
"""


def count_first_elements(tup):
    count = 0
    for i in range(len(tup)):
        if i == 0:
            continue
        if tup[i] == tup[i - 1]:
            count += 1
    return count




--------------------------------------------------Mbpp/279--------------------------------------------------

<s> """
Write a function to find the nth decagonal number.
assert is_num_decagonal(3) == 27
"""


def is_num_decagonal(n):
    """
    Check if a number is a decagonal number.
    """
    if n < 1:
        return False
    if n == 1:
        return True
    if n % 2 == 0:
        return is_num_decagonal(n - 1)
    return is_num_decagonal(n - 2)




--------------------------------------------------Mbpp/280--------------------------------------------------

<s> """
Write a function that takes in an array and element and returns a tuple containing a boolean that indicates if the element is in the array and the index position of the element (or -1 if the element is not found).
assert sequential_search([11,23,58,31,56,77,43,12,65,19],31) == (True, 3)
"""

def sequential_search(arr, element):
    for i in range(len(arr)):
        if arr[i] == element:
            return True, i
    return False, -1



--------------------------------------------------Mbpp/281--------------------------------------------------

<s> """
Write a python function to check if the elements of a given list are unique or not.
assert all_unique([1,2,3]) == True
"""


def all_unique(lst):
    return len(lst) == len(set(lst))




--------------------------------------------------Mbpp/282--------------------------------------------------

<s> """
Write a function to subtract two lists element-wise.
assert sub_list([1, 2, 3],[4,5,6])==[-3,-3,-3]
"""

def sub_list(list1, list2):
    """
    Subtract two lists element-wise.
    """
    if len(list1) != len(list2):
        raise ValueError("Lists must be of equal length")
    else:
        return [x - y for x, y in zip(list1, list2)]




--------------------------------------------------Mbpp/283--------------------------------------------------

<s> """
Write a python function takes in an integer and check whether the frequency of each digit in the integer is less than or equal to the digit itself.
assert validate(1234) == True
"""


def validate(n):
    freq = [0] * 10
    while n:
        freq[n % 10] += 1
        n //= 10
    for i in range(10):
        if freq[i] > i:
            return False
    return True




--------------------------------------------------Mbpp/284--------------------------------------------------

<s> """
Write a function that takes in a list and element and checks whether all items in the list are equal to the given element.
assert check_element(["green", "orange", "black", "white"],'blue')==False
"""


def check_element(list, element):
    for item in list:
        if item != element:
            return False
    return True




--------------------------------------------------Mbpp/285--------------------------------------------------

<s> """
Write a function that checks whether a string contains the 'a' character followed by two or three 'b' characters.
assert text_match_two_three("ac")==(False)
"""


def text_match_two_three(text):
    if text.find('a') == -1:
        return False
    else:
        if text[text.find('a') + 1] == 'b':
            if text[text.find('a') + 2] == 'b':
                return True
            elif text[text.find('a') + 3] == 'b':
                return True
            else:
                return False
        else:
            return False




--------------------------------------------------Mbpp/286--------------------------------------------------

<s> """
Write a function to find the largest sum of a contiguous array in the modified array which is formed by repeating the given array k times.
assert max_sub_array_sum_repeated([10, 20, -30, -1], 4, 3) == 30
"""


def max_sub_array_sum_repeated(arr, k, n):
    """
    :param arr: array of integers
    :param k: number of times to repeat the array
    :param n: number of elements in the modified array
    :return: largest sum of a contiguous array in the modified array which is formed by repeating the given array k times
    """
    if k == 1:
        return max(arr)
    if k == 2:
        return max(arr) + max(arr)
    if k == 3:
        return max(arr) + max(arr) + max(arr)
    if k == 4:
        return max(arr) + max(arr) + max(arr) + max(arr)
    if k == 5:
        return max(arr) + max(arr) + max(arr) + max(arr) + max(arr)
    if k == 6:
        return max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr)
    if k == 7:
        return max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr)
    if k == 8:
        return max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr)
    if k == 9:
        return max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr)
    if k == 10:
        return max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr)
    if k == 11:
        return max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr)
    if k == 12:
        return max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr)
    if k == 13:
        return max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(arr) + max(

--------------------------------------------------Mbpp/287--------------------------------------------------

<s> """
Write a python function takes in an integer n and returns the sum of squares of first n even natural numbers.
assert square_Sum(2) == 20
"""


def square_Sum(n):
    """
    :param n: int
    :return: int
    """
    even_natural_numbers = [i for i in range(2, n + 1, 2)]
    return sum([i ** 2 for i in even_natural_numbers])




--------------------------------------------------Mbpp/290--------------------------------------------------

<s> """
Write a function to find the list of maximum length in a list of lists.
assert max_length([[0], [1, 3], [5, 7], [9, 11], [13, 15, 17]])==(3, [13, 15, 17])
"""


def max_length(lst):
    """
    :param lst: list of lists
    :return: tuple of max length and list of max length
    """
    max_len = 0
    max_len_list = []
    for i in lst:
        if len(i) > max_len:
            max_len = len(i)
            max_len_list = i
    return max_len, max_len_list




--------------------------------------------------Mbpp/292--------------------------------------------------

<s> """
Write a python function to find quotient of two numbers (rounded down to the nearest integer).
assert find(10,3) == 3
"""


def find(a, b):
    return int(a/b)




--------------------------------------------------Mbpp/293--------------------------------------------------

<s> """
Write a function to find the third side of a right angled triangle.
assert otherside_rightangle(7,8)==10.63014581273465
"""


def third_side(side1, side2):
    """
    Write a function to find the third side of a right angled triangle.
    assert otherside_rightangle(7,8)==10.63014581273465
    """
    return (side1**2 + side2**2)**0.5




--------------------------------------------------Mbpp/294--------------------------------------------------

<s> """
Write a function to find the maximum value in a given heterogeneous list.
assert max_val(['Python', 3, 2, 4, 5, 'version'])==5
"""


def max_val(heterogeneous_list):
    """
    Write a function to find the maximum value in a given heterogeneous list.
    assert max_val(['Python', 3, 2, 4, 5, 'version'])==5
    """
    max_val = heterogeneous_list[0]
    for i in heterogeneous_list:
        if type(i) == int:
            if i > max_val:
                max_val = i
        elif type(i) == str:
            if len(i) > len(max_val):
                max_val = i
        elif type(i) == float:
            if i > max_val:
                max_val = i
        elif type(i) == list:
            if len(i) > len(max_val):
                max_val = i
        elif type(i) == tuple:
            if len(i) > len(max_val):
                max_val = i
        elif type(i) == dict:
            if len(i) > len(max_val):
                max_val = i
        elif type(i) == set:
            if len(i) > len(max_val):
                max_val = i
        elif type(i) == frozenset:
            if len(i) > len(max_val):
                max_val = i
        elif type(i) == bool:
            if i > max_val:
                max_val = i
        elif type(i) == bytes:
            if len(i) > len(max_val):
                max_val = i
        elif type(i) == bytearray:
            if len(i) > len(max_val):
                max_val = i
        elif type(i) == memoryview:
            if len(i) > len(max_val):
                max_val = i
        elif type(i) == complex:
            if i > max_val:
                max_val = i
        elif type(i) == range:
            if len(i) > len(max_val):
                max_val = i

--------------------------------------------------Mbpp/295--------------------------------------------------

<s> """
Write a function to return the sum of all divisors of a number.
assert sum_div(8)==7
"""


def sum_div(n):
    """
    :param n: int
    :return: int
    """
    sum_divisors = 0
    for i in range(1, n + 1):
        if n % i == 0:
            sum_divisors += i
    return sum_divisors




--------------------------------------------------Mbpp/296--------------------------------------------------

<s> """
Write a python function to count inversions in an array.
assert get_Inv_Count([1,20,6,4,5]) == 5
"""


def get_Inv_Count(arr):
    if len(arr) <= 1:
        return 0
    mid = len(arr) // 2
    left = arr[:mid]
    right = arr[mid:]
    left_inv = get_Inv_Count(left)
    right_inv = get_Inv_Count(right)
    merged_inv = merge_inv(left, right)
    return left_inv + right_inv + merged_inv




--------------------------------------------------Mbpp/297--------------------------------------------------

<s> """
Write a function to flatten a given nested list structure.
assert flatten_list([0, 10, [20, 30], 40, 50, [60, 70, 80], [90, 100, 110, 120]])==[0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120]
"""


def flatten_list(nested_list):
    """
    :param nested_list: list
    :return: list
    """
    result = []
    for item in nested_list:
        if isinstance(item, list):
            result.extend(flatten_list(item))
        else:
            result.append(item)
    return result




--------------------------------------------------Mbpp/299--------------------------------------------------

<s> """
Write a function to calculate the maximum aggregate from the list of tuples.
assert max_aggregate([('Juan Whelan',90),('Sabah Colley',88),('Peter Nichols',7),('Juan Whelan',122),('Sabah Colley',84)])==('Juan Whelan', 212)
"""

def max_aggregate(tuples):
    max_aggregate = 0
    for name, aggregate in tuples:
        if aggregate > max_aggregate:
            max_aggregate = aggregate
            max_name = name
    return max_name, max_aggregate



--------------------------------------------------Mbpp/300--------------------------------------------------

<s> """
Write a function to find the count of all binary sequences of length 2n such that sum of first n bits is same as sum of last n bits.
assert math.isclose(count_binary_seq(1), 2.0, rel_tol=0.001)
"""


--------------------------------------------------Mbpp/301--------------------------------------------------

<s> """
Write a function to find the depth of a dictionary.
assert dict_depth({'a':1, 'b': {'c': {'d': {}}}})==4
"""


def dict_depth(d):
    if isinstance(d, dict):
        return 1 + max(map(dict_depth, d.values()))
    else:
        return 0




--------------------------------------------------Mbpp/305--------------------------------------------------

<s> """
Write a function to return two words from a list of words starting with letter 'p'.
assert start_withp(["Python PHP", "Java JavaScript", "c c++"])==('Python', 'PHP')
"""


def start_withp(words):
    """
    :param words: list of words
    :return: tuple of two words starting with letter 'p'
    """
    for word in words:
        if word[0] == 'p':
            return word.split()




--------------------------------------------------Mbpp/306--------------------------------------------------

<s> """
Write a function to find the maximum sum of increasing subsequence from prefix until ith index and also including a given kth element which is after i, i.e., k > i .
assert max_sum_increasing_subseq([1, 101, 2, 3, 100, 4, 5 ], 7, 4, 6) == 11
"""


def max_sum_increasing_subseq(arr, i, k, n):
    if i == n:
        return 0
    if i == k:
        return arr[i]
    if i > k:
        return max(max_sum_increasing_subseq(arr, i, k, n), arr[i] + max_sum_increasing_subseq(arr, i + 1, k, n))
    return max_sum_increasing_subseq(arr, i + 1, k, n)




--------------------------------------------------Mbpp/308--------------------------------------------------

<s> """
Write a function to find the specified number of largest products from two given lists, selecting one factor from each list.
assert large_product([1, 2, 3, 4, 5, 6],[3, 6, 8, 9, 10, 6],3)==[60, 54, 50]
"""

def large_product(list1, list2, n):
    """
    :param list1: list of numbers
    :param list2: list of numbers
    :param n: number of largest products to return
    :return: list of n largest products
    """
    if n > len(list1) or n > len(list2):
        raise ValueError("n must be less than or equal to the length of each list")
    if n < 1:
        raise ValueError("n must be greater than 0")
    if len(list1) == 0 or len(list2) == 0:
        raise ValueError("lists must not be empty")
    if len(list1) == 1 and len(list2) == 1:
        return [list1[0] * list2[0]]
    if len(list1) == 1:
        return [list1[0] * factor for factor in list2]
    if len(list2) == 1:
        return [list1[0] * factor for factor in list1]
    if len(list1) == 2 and len(list2) == 2:
        return [list1[0] * list2[0], list1[0] * list2[1], list1[1] * list2[0]]
    if len(list1) == 2 and len(list2) == 3:
        return [list1[0] * list2[0], list1[0] * list2[1], list1[0] * list2[2], list1[1] * list2[0], list1[1] * list2[1], list1[1] * list2[2]]
    if len(list1) == 3 and len(list2) == 2:
        return [list1[0] * list2[0], list1[0] * list2[1], list1[1] * list2[0], list1[1] * list2[1], list1[2] * list2[0], list1[2] * list2[1]]
    if len(list1) == 3 and len(list2) == 3:
        return [list1[0] * list2[0], list1[0] * list2[1], list1[0] * list2[2], list1[1] * list2[0], list1[1] * list2[1], list1[1] * list2[2], list1[2] * list2[0], list1[2] * list2[1], list1[2] * list2[2]]
    if len(list1) == 4 and len(list2) == 2:
        return [list1[0] * list2[0], list1[0] * list2[1], list1[1

--------------------------------------------------Mbpp/309--------------------------------------------------

<s> """
Write a python function to find the maximum of two numbers.
assert maximum(5,10) == 10
"""


def maximum(a, b):
    """
    Write a python function to find the maximum of two numbers.
    assert maximum(5,10) == 10
    """
    if a > b:
        return a
    else:
        return b




--------------------------------------------------Mbpp/310--------------------------------------------------

<s> """
Write a function to convert a given string to a tuple of characters.
assert string_to_tuple("python 3.0")==('p', 'y', 't', 'h', 'o', 'n', '3', '.', '0')
"""


def string_to_tuple(string):
    return tuple(string)




--------------------------------------------------Mbpp/311--------------------------------------------------

<s> """
Write a python function to set the left most unset bit.
assert set_left_most_unset_bit(10) == 14
"""


def set_left_most_unset_bit(n):
    """
    :param n: int
    :return: int
    """
    return n | (n + 1)




--------------------------------------------------Mbpp/312--------------------------------------------------

<s> """
Write a function to find the volume of a cone.
assert math.isclose(volume_cone(5,12), 314.15926535897927, rel_tol=0.001)
"""



--------------------------------------------------Mbpp/388--------------------------------------------------

<s> """
Write a python function to find the highest power of 2 that is less than or equal to n.
assert highest_Power_of_2(10) == 8
"""


def highest_Power_of_2(n):
    """
    Write a python function to find the highest power of 2 that is less than or equal to n.
    assert highest_Power_of_2(10) == 8
    """
    if n == 0:
        return 0
    if n == 1:
        return 1
    if n == 2:
        return 2
    if n == 3:
        return 2
    if n == 4:
        return 4
    if n == 5:
        return 4
    if n == 6:
        return 4
    if n == 7:
        return 4
    if n == 8:
        return 8
    if n == 9:
        return 8
    if n == 10:
        return 8
    if n == 11:
        return 8
    if n == 12:
        return 8
    if n == 13:
        return 8
    if n == 14:
        return 8
    if n == 15:
        return 8
    if n == 16:
        return 16
    if n == 17:
        return 16
    if n == 18:
        return 16
    if n == 19:
        return 16
    if n == 20:
        return 16
    if n == 21:
        return 16

--------------------------------------------------Mbpp/389--------------------------------------------------

<s> """
Write a function to find the n'th lucas number.
assert find_lucas(9) == 76
"""


def find_lucas(n):
    """
    Write a function to find the n'th lucas number.
    assert find_lucas(9) == 76
    """
    if n == 1:
        return 2
    elif n == 2:
        return 1
    else:
        return find_lucas(n - 1) + find_lucas(n - 2)




--------------------------------------------------Mbpp/390--------------------------------------------------

<s> """
Write a function to apply a given format string to all of the elements in a list.
assert add_string([1,2,3,4],'temp{0}')==['temp1', 'temp2', 'temp3', 'temp4']
"""


def add_string(list, format_string):
    return [format_string.format(i) for i in list]




--------------------------------------------------Mbpp/391--------------------------------------------------

<s> """
Write a function to convert more than one list to nested dictionary.
assert convert_list_dictionary(["S001", "S002", "S003", "S004"],["Adina Park", "Leyton Marsh", "Duncan Boyle", "Saim Richards"] ,[85, 98, 89, 92])==[{'S001': {'Adina Park': 85}}, {'S002': {'Leyton Marsh': 98}}, {'S003': {'Duncan Boyle': 89}}, {'S004': {'Saim Richards': 92}}]
"""

def convert_list_dictionary(list1, list2, list3):
    """
    Convert more than one list to nested dictionary.
    """
    return [dict(zip(list1, [dict(zip(list2, [list3[i]])) for i in range(len(list1))]))]




--------------------------------------------------Mbpp/392--------------------------------------------------

<s> """
Write a function to find the maximum sum possible by using the given equation f(n) = max( (f(n/2) + f(n/3) + f(n/4) + f(n/5)), n).
assert get_max_sum(60) == 106
"""


def get_max_sum(n):
    """
    :param n: int
    :return: int
    """
    if n <= 1:
        return n
    f = [0] * (n + 1)
    f[1] = 1
    for i in range(2, n + 1):
        f[i] = max(f[int(i / 2)] + f[int(i / 3)] + f[int(i / 4)] + f[int(i / 5)], i)
    return f[n]




--------------------------------------------------Mbpp/394--------------------------------------------------

<s> """
Write a function to check if given tuple contains no duplicates.
assert check_distinct((1, 4, 5, 6, 1, 4)) == False
"""


def check_distinct(tup):
    """
    Check if given tuple contains no duplicates.
    :param tup: tuple
    :return: bool
    """
    return len(tup) == len(set(tup))




--------------------------------------------------Mbpp/395--------------------------------------------------

<s> """
Write a python function to find the first non-repeated character in a given string.
assert first_non_repeating_character("abcabc") == None
"""


def first_non_repeating_character(string):
    """
    :param string: string
    :return: first non-repeated character
    """
    if not string:
        return None

    char_count = {}
    for char in string:
        if char in char_count:
            char_count[char] += 1
        else:
            char_count[char] = 1

    for char in string:
        if char_count[char] == 1:
            return char

    return None




--------------------------------------------------Mbpp/396--------------------------------------------------

<s> """
Write a function to check whether the given string starts and ends with the same character or not.
assert check_char("abba") == "Valid"
"""


def check_char(string):
    if string[0] == string[-1]:
        return "Valid"
    else:
        return "Invalid"




--------------------------------------------------Mbpp/397--------------------------------------------------

<s> """
Write a function to find the median of three numbers.
assert median_numbers(25,55,65)==55.0
"""


def median_numbers(num1, num2, num3):
    """
    Write a function to find the median of three numbers.
    assert median_numbers(25,55,65)==55.0
    """
    if num1 > num2:
        num1, num2 = num2, num1
    if num2 > num3:
        num2, num3 = num3, num2
    if num1 > num2:
        num1, num2 = num2, num1
    if num2 == num3:
        return (num1 + num2) / 2
    if num1 == num2:
        return num3
    if num1 == num3:
        return num2
    if num2 == num3:
        return num1
    if num1 < num2 < num3:
        return num2
    if num1 < num3 < num2:
        return num3
    if num2 < num1 < num3:
        return num1
    if num2 < num3 < num1:
        return num3
    if num3 < num1 < num2:
        return num1
    if num3 < num2 < num1:
        return num2




--------------------------------------------------Mbpp/398--------------------------------------------------

<s> """
Write a function to compute the sum of digits of each number of a given list.
assert sum_of_digits([10,2,56])==14
"""


def sum_of_digits(numbers):
    """
    Compute the sum of digits of each number of a given list.
    :param numbers: list of numbers
    :return: sum of digits of each number of a given list
    """
    return sum(sum(map(int, str(number))) for number in numbers)




--------------------------------------------------Mbpp/400--------------------------------------------------

<s> """
Write a function to extract the number of unique tuples in the given list.
assert extract_freq([(3, 4), (1, 2), (4, 3), (5, 6)] ) == 3
"""


def extract_freq(tuples):
    """
    Write a function to extract the number of unique tuples in the given list.
    assert extract_freq([(3, 4), (1, 2), (4, 3), (5, 6)] ) == 3
    """
    unique_tuples = set()
    for tuple in tuples:
        unique_tuples.add(tuple)
    return len(unique_tuples)




--------------------------------------------------Mbpp/404--------------------------------------------------

<s> """
Write a python function to find the minimum of two numbers.
assert minimum(1,2) == 1
"""


def minimum(a, b):
    """
    Write a python function to find the minimum of two numbers.
    assert minimum(1,2) == 1
    """
    if a < b:
        return a
    else:
        return b




--------------------------------------------------Mbpp/405--------------------------------------------------

<s> """
Write a function to check whether an element exists within a tuple.
assert check_tuplex(("w", 3, "r", "e", "s", "o", "u", "r", "c", "e"),'r')==True
"""


def check_tuplex(tup, element):
    """
    :param tup: tuple
    :param element: element to check
    :return: True if element exists in tuple, False otherwise
    """
    return element in tup




--------------------------------------------------Mbpp/406--------------------------------------------------

<s> """
Write a python function to find whether the parity of a given number is odd.
assert find_Parity(12) == False
"""


def find_parity(num):
    if num % 2 == 0:
        return True
    else:
        return False




--------------------------------------------------Mbpp/407--------------------------------------------------

<s> """
Write a function to create the next bigger number by rearranging the digits of a given number.
assert rearrange_bigger(12)==21
"""


def rearrange_bigger(number):
    """
    :param number: int
    :return: int
    """
    number = str(number)
    number_list = list(number)
    number_list.sort(reverse=True)
    number_list = ''.join(number_list)
    return int(number_list)




--------------------------------------------------Mbpp/409--------------------------------------------------

<s> """
Write a function to find the minimum product from the pairs of tuples within a given list.
assert min_product_tuple([(2, 7), (2, 6), (1, 8), (4, 9)] )==8
"""


def min_product_tuple(tuples):
    """
    :param tuples: list of tuples
    :return: minimum product from the pairs of tuples within a given list
    """
    if not tuples:
        return None
    tuples.sort(key=lambda x: x[0])
    min_product = tuples[0][0] * tuples[0][1]
    for i in range(1, len(tuples)):
        if tuples[i][0] * tuples[i][1] < min_product:
            min_product = tuples[i][0] * tuples[i][1]
    return min_product




--------------------------------------------------Mbpp/410--------------------------------------------------

<s> """
Write a function to find the minimum value in a given heterogeneous list.
assert min_val(['Python', 3, 2, 4, 5, 'version'])==2
"""


def min_val(heterogeneous_list):
    """
    Write a function to find the minimum value in a given heterogeneous list.
    assert min_val(['Python', 3, 2, 4, 5, 'version'])==2
    """
    min_val = heterogeneous_list[0]
    for i in heterogeneous_list:
        if type(i) == str:
            if i < min_val:
                min_val = i
        elif type(i) == int:
            if i < min_val:
                min_val = i
        elif type(i) == float:
            if i < min_val:
                min_val = i
        elif type(i) == bool:
            if i < min_val:
                min_val = i
        elif type(i) == list:
            if i < min_val:
                min_val = i
        elif type(i) == tuple:
            if i < min_val:
                min_val = i
        elif type(i) == dict:
            if i < min_val:
                min_val = i
        elif type(i) == set:
            if i < min_val:
                min_val = i
        elif type(i) == frozenset:
            if i < min_val:
                min_val = i
        elif type(i) == bytes:
            if i < min_val:
                min_val = i
        elif type(i) == bytearray:
            if i < min_val:
                min_val = i
        elif type(i) == memoryview:
            if i < min_val:
                min_val = i
        elif type(i) == range:
            if i < min_val:
                min_val = i
        elif type(i) == complex:
            if i < min_val:
                min_val = i

--------------------------------------------------Mbpp/412--------------------------------------------------

<s> """
Write a python function to remove odd numbers from a given list.
assert remove_odd([1,2,3]) == [2]
"""


def remove_odd(nums):
    """
    :param nums: list of numbers
    :return: list of numbers without odd numbers
    """
    return [num for num in nums if num % 2 == 0]




--------------------------------------------------Mbpp/413--------------------------------------------------

<s> """
Write a function to extract the nth element from a given list of tuples.
assert extract_nth_element([('Greyson Fulton', 98, 99), ('Brady Kent', 97, 96), ('Wyatt Knott', 91, 94), ('Beau Turnbull', 94, 98)] ,0)==['Greyson Fulton', 'Brady Kent', 'Wyatt Knott', 'Beau Turnbull']
"""

def extract_nth_element(tuples, n):
    return [t[n] for t in tuples]



--------------------------------------------------Mbpp/414--------------------------------------------------

<s> """
Write a python function to check whether any value in a sequence exists in a sequence or not.
assert overlapping([1,2,3,4,5],[6,7,8,9]) == False
"""

def overlapping(seq1, seq2):
    for i in seq1:
        if i in seq2:
            return True
    return False



--------------------------------------------------Mbpp/415--------------------------------------------------

<s> """
Write a python function to find a pair with highest product from a given array of integers.
assert max_Product([1,2,3,4,7,0,8,4]) == (7,8)
"""


def max_Product(arr):
    arr.sort()
    return arr[-2], arr[-1]




--------------------------------------------------Mbpp/418--------------------------------------------------

<s> """
Write a python function to find the element of a list having maximum length.
assert Find_Max([['A'],['A','B'],['A','B','C']]) == ['A','B','C']
"""


def Find_Max(lst):
    max_len = 0
    max_len_element = []
    for i in lst:
        if len(i) > max_len:
            max_len = len(i)
            max_len_element = i
    return max_len_element




--------------------------------------------------Mbpp/419--------------------------------------------------

<s> """
Write a function to round every number of a given list of numbers and print the total sum multiplied by the length of the list.
assert round_and_sum([22.4, 4.0, -16.22, -9.10, 11.00, -12.22, 14.20, -5.20, 17.50])==243
"""


def round_and_sum(numbers):
    total = 0
    for number in numbers:
        total += round(number)
    return len(numbers) * total




--------------------------------------------------Mbpp/420--------------------------------------------------

<s> """
Write a python function to find the cube sum of first n even natural numbers.
assert cube_Sum(2) == 72
"""


def cube_Sum(n):
    even_natural_numbers = [i for i in range(2, n + 1) if i % 2 == 0]
    return sum([i ** 3 for i in even_natural_numbers])




--------------------------------------------------Mbpp/421--------------------------------------------------

<s> """
Write a function to concatenate each element of tuple by the delimiter.
assert concatenate_tuple(("ID", "is", 4, "UTS") ) == 'ID-is-4-UTS'
"""


def concatenate_tuple(tuple_data, delimiter='-'):
    return delimiter.join(str(x) for x in tuple_data)




--------------------------------------------------Mbpp/422--------------------------------------------------

<s> """
Write a python function to find the average of cubes of first n natural numbers.
assert find_Average_Of_Cube(2) == 4.5
"""


def find_Average_Of_Cube(n):
    sum = 0
    for i in range(1, n+1):
        sum += i**3
    return sum / n




--------------------------------------------------Mbpp/424--------------------------------------------------

<s> """
Write a function to extract only the rear index element of each string in the given tuple.
assert extract_rear(('Mers', 'for', 'Vers') ) == ['s', 'r', 's']
"""

def extract_rear(tup):
    return [s[-1] for s in tup]



--------------------------------------------------Mbpp/425--------------------------------------------------

<s> """
Write a function to count the number of sublists containing a particular element.
assert count_element_in_list([[1, 3], [5, 7], [1, 11], [1, 15, 7]],1)==3
"""


def count_element_in_list(lst, element):
    """
    :param lst: list of lists
    :param element: element to count
    :return: number of sublists containing element
    """
    count = 0
    for sublist in lst:
        if element in sublist:
            count += 1
    return count




--------------------------------------------------Mbpp/426--------------------------------------------------

<s> """
Write a function to filter odd numbers.
assert filter_oddnumbers([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])==[1,3,5,7,9]
"""


def filter_oddnumbers(numbers):
    return [x for x in numbers if x % 2 == 0]




--------------------------------------------------Mbpp/427--------------------------------------------------

<s> """
Write a function to convert a date of yyyy-mm-dd format to dd-mm-yyyy format.
assert change_date_format("2026-01-02") == '02-01-2026'
"""


def change_date_format(date):
    """
    Write a function to convert a date of yyyy-mm-dd format to dd-mm-yyyy format.
    assert change_date_format("2026-01-02") == '02-01-2026'
    """
    return "-".join(reversed(date.split("-")))




--------------------------------------------------Mbpp/428--------------------------------------------------

<s> """
Write a function to sort the given array by using shell sort.
assert shell_sort([12, 23, 4, 5, 3, 2, 12, 81, 56, 95]) == [2, 3, 4, 5, 12, 12, 23, 56, 81, 95]
"""


def shell_sort(arr):
    """
    Sort the given array by using shell sort.
    :param arr: the given array
    :return: the sorted array
    """
    # 1. Find the gap
    gap = len(arr) // 2
    while gap > 0:
        # 2. Sort the array by using insertion sort
        for i in range(gap, len(arr)):
            temp = arr[i]
            j = i - gap
            while j >= 0 and arr[j] > temp:
                arr[j + gap] = arr[j]
                j -= gap
            arr[j + gap] = temp
        # 3. Reduce the gap
        gap = gap // 2
    return arr




--------------------------------------------------Mbpp/429--------------------------------------------------

<s> """
Write a function to extract the elementwise and tuples from the given two tuples.
assert and_tuples((10, 4, 6, 9), (5, 2, 3, 3)) == (0, 0, 2, 1)
"""


def and_tuples(t1, t2):
    """
    Write a function to extract the elementwise and tuples from the given two tuples.
    assert and_tuples((10, 4, 6, 9), (5, 2, 3, 3)) == (0, 0, 2, 1)
    """
    return tuple(t1[i] & t2[i] for i in range(len(t1)))




--------------------------------------------------Mbpp/430--------------------------------------------------

<s> """
Write a function to find the directrix of a parabola.
assert parabola_directrix(5,3,2)==-198
"""


def parabola_directrix(a, b, c):
    """
    Write a function to find the directrix of a parabola.
    assert parabola_directrix(5,3,2)==-198
    """
    return -b/(2*a)




--------------------------------------------------Mbpp/431--------------------------------------------------

<s> """
Write a function that takes two lists and returns true if they have at least one common element.
assert common_element([1,2,3,4,5], [5,6,7,8,9])==True
"""


def common_element(list1, list2):
    """
    :param list1: list
    :param list2: list
    :return: bool
    """
    for i in list1:
        if i in list2:
            return True
    return False




--------------------------------------------------Mbpp/432--------------------------------------------------

<s> """
Write a function to find the median length of a trapezium.
assert median_trapezium(15,25,35)==20
"""


def median_trapezium(a, b, c):
    """
    Write a function to find the median length of a trapezium.
    assert median_trapezium(15,25,35)==20
    """
    if a > b:
        a, b = b, a
    if a > c:
        a, c = c, a
    if b > c:
        b, c = c, b
    if a == b == c:
        return a
    if a == b:
        return a
    if a == c:
        return a
    if b == c:
        return b
    if a < b < c:
        return (a + b + c) / 3
    if a < c < b:
        return (a + b + c) / 3
    if b < a < c:
        return (a + b + c) / 3
    if b < c < a:
        return (a + b + c) / 3
    if c < a < b:
        return (a + b + c) / 3
    if c < b < a:
        return (a + b + c) / 3




--------------------------------------------------Mbpp/433--------------------------------------------------

<s> """
Write a function to check whether the entered number is greater than the elements of the given array.
assert check_greater([1, 2, 3, 4, 5], 4) == False
"""


def check_greater(arr, num):
    for i in arr:
        if num > i:
            return False
    return True




--------------------------------------------------Mbpp/435--------------------------------------------------

<s> """
Write a python function to find the last digit of a given number.
assert last_Digit(123) == 3
"""


def last_digit(num):
    """
    :param num: int
    :return: int
    """
    return num % 10




--------------------------------------------------Mbpp/436--------------------------------------------------

<s> """
Write a python function to return the negative numbers in a list.
assert neg_nos([-1,4,5,-6]) == [-1,-6]
"""


def neg_nos(nums):
    return [x for x in nums if x < 0]




--------------------------------------------------Mbpp/437--------------------------------------------------

<s> """
Write a function to remove odd characters in a string.
assert remove_odd("python")==("yhn")
"""


def remove_odd(string):
    """
    Write a function to remove odd characters in a string.
    assert remove_odd("python")==("yhn")
    """
    odd_characters = []
    for character in string:
        if character.isalpha():
            if character.isupper():
                odd_characters.append(character.lower())
            else:
                odd_characters.append(character.upper())
    return ''.join(odd_characters)




--------------------------------------------------Mbpp/438--------------------------------------------------

<s> """
Write a function to count bidirectional tuple pairs.
assert count_bidirectional([(5, 6), (1, 2), (6, 5), (9, 1), (6, 5), (2, 1)] ) == 3
"""

def count_bidirectional(tuples):
    """
    Write a function to count bidirectional tuple pairs.
    assert count_bidirectional([(5, 6), (1, 2), (6, 5), (9, 1), (6, 5), (2, 1)] ) == 3
    """
    count = 0
    for i in range(len(tuples)):
        for j in range(i+1, len(tuples)):
            if tuples[i][0] == tuples[j][1] and tuples[i][1] == tuples[j][0]:
                count += 1
    return count




--------------------------------------------------Mbpp/439--------------------------------------------------

<s> """
Write a function to join a list of multiple integers into a single integer.
assert multiple_to_single([11, 33, 50])==113350
"""


def multiple_to_single(lst):
    """
    Write a function to join a list of multiple integers into a single integer.
    assert multiple_to_single([11, 33, 50])==113350
    """
    return int(''.join(map(str, lst)))




--------------------------------------------------Mbpp/440--------------------------------------------------

<s> """
Write a function to find the first adverb and their positions in a given sentence.
assert find_adverb_position("clearly!! we can see the sky")==(0, 7, 'clearly')
"""



--------------------------------------------------Mbpp/441--------------------------------------------------

<s> """
Write a function to find the surface area of a cube of a given size.
assert surfacearea_cube(5)==150
"""


def surfacearea_cube(size):
    """
    Write a function to find the surface area of a cube of a given size.
    assert surfacearea_cube(5)==150
    """
    return 6 * size ** 2




--------------------------------------------------Mbpp/442--------------------------------------------------

<s> """
Write a function to find the ration of positive numbers in an array of integers.
assert positive_count([0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8])==0.54
"""


def positive_count(arr):
    count = 0
    for i in arr:
        if i > 0:
            count += 1
    return count / len(arr)




--------------------------------------------------Mbpp/445--------------------------------------------------

<s> """
Write a function to perform index wise multiplication of tuple elements in the given two tuples.
assert index_multiplication(((1, 3), (4, 5), (2, 9), (1, 10)),((6, 7), (3, 9), (1, 1), (7, 3)) ) == ((6, 21), (12, 45), (2, 9), (7, 30))
"""


def index_multiplication(t1, t2):
    """
    Write a function to perform index wise multiplication of tuple elements in the given two tuples.
    assert index_multiplication(((1, 3), (4, 5), (2, 9), (1, 10)),((6, 7), (3, 9), (1, 1), (7, 3)) ) == ((6, 21), (12, 45), (2, 9), (7, 30))
    """
    if len(t1) != len(t2):
        raise ValueError("Tuples must be of same length")
    return tuple(map(lambda x, y: tuple(map(lambda a, b: a * b, x, y)), t1, t2))




--------------------------------------------------Mbpp/446--------------------------------------------------

<s> """
Write a python function to count the occurence of all elements of list in a tuple.
assert count_Occurrence(('a', 'a', 'c', 'b', 'd'),['a', 'b'] ) == 3
"""


def count_Occurrence(tuple_list, list_list):
    """
    Write a python function to count the occurence of all elements of list in a tuple.
    assert count_Occurrence(('a', 'a', 'c', 'b', 'd'),['a', 'b'] ) == 3
    """
    count = 0
    for i in list_list:
        count += tuple_list.count(i)
    return count




--------------------------------------------------Mbpp/447--------------------------------------------------

<s> """
Write a function to find cubes of individual elements in a list.
assert cube_nums([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])==[1, 8, 27, 64, 125, 216, 343, 512, 729, 1000]
"""


def cube_nums(nums):
    """
    Write a function to find cubes of individual elements in a list.
    assert cube_nums([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])==[1, 8, 27, 64, 125, 216, 343, 512, 729, 1000]
    """
    return [num ** 3 for num in nums]




--------------------------------------------------Mbpp/448--------------------------------------------------

<s> """
Write a function to calculate the sum of perrin numbers.
assert cal_sum(9) == 49
"""


def cal_perrin(n):
    if n == 1:
        return 1
    else:
        return 2 * cal_perrin(n - 1) + 1




--------------------------------------------------Mbpp/450--------------------------------------------------

<s> """
Write a function to extract specified size of strings from a given list of string values.
assert extract_string(['Python', 'list', 'exercises', 'practice', 'solution'] ,8)==['practice', 'solution']
"""


def extract_string(values, size):
    """
    :param values: list of string values
    :param size: size of string to extract
    :return: list of string values
    """
    return [value[len(value) - size:] for value in values]




--------------------------------------------------Mbpp/451--------------------------------------------------

<s> """
Write a function to remove all whitespaces from the given string.
assert remove_whitespaces(' Google    Flutter ') == 'GoogleFlutter'
"""


def remove_whitespaces(string):
    """
    Write a function to remove all whitespaces from the given string.
    assert remove_whitespaces(' Google    Flutter ') == 'GoogleFlutter'
    """
    return ''.join(string.split())




--------------------------------------------------Mbpp/453--------------------------------------------------

<s> """
Write a python function to find the sum of even factors of a number.
assert sumofFactors(18) == 26
"""


def sumofFactors(n):
    """
    :param n: int
    :return: int
    """
    sum_even_factors = 0
    for i in range(1, n + 1):
        if n % i == 0:
            if i % 2 == 0:
                sum_even_factors += i
    return sum_even_factors




--------------------------------------------------Mbpp/454--------------------------------------------------

<s> """
Write a function that matches a word containing 'z'.
assert text_match_wordz("pythonz.")==True
"""

def text_match_wordz(text):
    return "z" in text




--------------------------------------------------Mbpp/455--------------------------------------------------

<s> """
Write a function to check whether the given month number contains 31 days or not.
assert check_monthnumb_number(5)==True
"""


def check_monthnumb_number(month_number):
    if month_number == 2:
        return False
    elif month_number in [1, 3, 5, 7, 8, 10, 12]:
        return True
    else:
        return False




--------------------------------------------------Mbpp/456--------------------------------------------------

<s> """
Write a function to reverse each string in a given list of string values.
assert reverse_string_list(['Red', 'Green', 'Blue', 'White', 'Black'])==['deR', 'neerG', 'eulB', 'etihW', 'kcalB']
"""


def reverse_string_list(string_list):
    return [string[::-1] for string in string_list]




--------------------------------------------------Mbpp/457--------------------------------------------------

<s> """
Write a python function to find the sublist having minimum length.
assert Find_Min([[1],[1,2],[1,2,3]]) == [1]
"""


def Find_Min(L):
    min_len = len(L[0])
    min_sublist = L[0]
    for sublist in L:
        if len(sublist) < min_len:
            min_len = len(sublist)
            min_sublist = sublist
    return min_sublist




--------------------------------------------------Mbpp/458--------------------------------------------------

<s> """
Write a function to find the area of a rectangle.
assert rectangle_area(10,20)==200
"""


def rectangle_area(length, width):
    """
    :param length: length of the rectangle
    :param width: width of the rectangle
    :return: area of the rectangle
    """
    return length * width




--------------------------------------------------Mbpp/459--------------------------------------------------

<s> """
Write a function to remove uppercase substrings from a given string.
assert remove_uppercase('cAstyoUrFavoRitETVshoWs') == 'cstyoravoitshos'
"""


def remove_uppercase(string):
    """
    Write a function to remove uppercase substrings from a given string.
    assert remove_uppercase('cAstyoUrFavoRitETVshoWs') == 'cstyoravoitshos'
    """
    result = ''
    for i in range(len(string)):
        if string[i].isupper():
            result += string[i].lower()
        else:
            result += string[i]
    return result




--------------------------------------------------Mbpp/460--------------------------------------------------

<s> """
Write a python function to get the first element of each sublist.
assert Extract([[1, 2], [3, 4, 5], [6, 7, 8, 9]]) == [1, 3, 6]
"""


def Extract(sublist):
    return [sublist[0] for sublist in sublist]




--------------------------------------------------Mbpp/461--------------------------------------------------

<s> """
Write a python function to count the upper case characters in a given string.
assert upper_ctr('PYthon') == 1
"""


def upper_ctr(string):
    """
    Write a python function to count the upper case characters in a given string.
    assert upper_ctr('PYthon') == 1
    """
    return sum(1 for c in string if c.isupper())




--------------------------------------------------Mbpp/462--------------------------------------------------

<s> """
Write a function to find all possible combinations of the elements of a given list.
assert combinations_list(['orange', 'red', 'green', 'blue'])==[[], ['orange'], ['red'], ['red', 'orange'], ['green'], ['green', 'orange'], ['green', 'red'], ['green', 'red', 'orange'], ['blue'], ['blue', 'orange'], ['blue', 'red'], ['blue', 'red', 'orange'], ['blue', 'green'], ['blue', 'green', 'orange'], ['blue', 'green', 'red'], ['blue', 'green', 'red', 'orange']]
"""


def combinations_list(list_):
    """
    Write a function to find all possible combinations of the elements of a given list.
    assert combinations_list(['orange', 'red', 'green', 'blue'])==[[], ['orange'], ['red'], ['red', 'orange'], ['green'], ['green', 'orange'], ['green', 'red'], ['green', 'red', 'orange'], ['blue'], ['blue', 'orange'], ['blue', 'red'], ['blue', 'red', 'orange'], ['blue', 'green'], ['blue', 'green', 'orange'], ['blue', 'green', 'red'], ['blue', 'green', 'red', 'orange']]
    """
    if not list_:
        return [[]]
    else:
        return [item + [list_[0]] for item in combinations_list(list_[1:])] + combinations_list(list_[1:])




--------------------------------------------------Mbpp/463--------------------------------------------------

<s> """
Write a function to find the maximum product subarray of the given array.
assert max_subarray_product([1, -2, -3, 0, 7, -8, -2]) == 112
"""


def max_subarray_product(arr):
    """
    :type arr: List[int]
    :rtype: int
    """
    max_so_far = max_ending_here = arr[0]
    for i in range(1, len(arr)):
        max_ending_here = max(arr[i], max_ending_here * arr[i])
        max_so_far = max(max_so_far, max_ending_here)
    return max_so_far




--------------------------------------------------Mbpp/465--------------------------------------------------

<s> """
Write a function to drop empty items from a given dictionary.
assert drop_empty({'c1': 'Red', 'c2': 'Green', 'c3':None})=={'c1': 'Red', 'c2': 'Green'}
"""


def drop_empty(d):
    return {k: v for k, v in d.items() if v is not None}




--------------------------------------------------Mbpp/468--------------------------------------------------

<s> """
Write a function to find the maximum product formed by multiplying numbers of an increasing subsequence of that array.
assert max_product([3, 100, 4, 5, 150, 6]) == 3000
"""


def max_product(arr):
    if len(arr) == 0:
        return 0
    if len(arr) == 1:
        return arr[0]
    max_product = arr[0]
    max_ending_here = arr[0]
    min_ending_here = arr[0]
    for i in range(1, len(arr)):
        max_ending_here = max(arr[i], max_ending_here * arr[i], min_ending_here * arr[i])
        min_ending_here = min(arr[i], max_ending_here * arr[i], min_ending_here * arr[i])
        max_product = max(max_product, max_ending_here)
    return max_product




--------------------------------------------------Mbpp/470--------------------------------------------------

<s> """
Write a function to find the pairwise addition of the neighboring elements of the given tuple.
assert add_pairwise((1, 5, 7, 8, 10)) == (6, 12, 15, 18)
"""


def add_pairwise(tup):
    """
    >>> add_pairwise((1, 5, 7, 8, 10))
    (6, 12, 15, 18)
    """
    return tuple(a + b for a, b in zip(tup, tup[1:]))




--------------------------------------------------Mbpp/471--------------------------------------------------

<s> """
Write a python function to find the product of the array multiplication modulo n.
assert find_remainder([ 100, 10, 5, 25, 35, 14 ],11) ==9
"""


def find_remainder(arr, n):
    product = 1
    for i in arr:
        product = (product * i) % n
    return product




--------------------------------------------------Mbpp/472--------------------------------------------------

<s> """
Write a python function to check whether the given list contains consecutive numbers or not.
assert check_Consecutive([1,2,3,4,5]) == True
"""


def check_Consecutive(arr):
    for i in range(len(arr) - 1):
        if arr[i + 1] - arr[i] != 1:
            return False
    return True




--------------------------------------------------Mbpp/473--------------------------------------------------

<s> """
Write a function to find the tuple intersection of elements in the given tuple list irrespective of their order.
assert tuple_intersection([(3, 4), (5, 6), (9, 10), (4, 5)] , [(5, 4), (3, 4), (6, 5), (9, 11)]) == {(4, 5), (3, 4), (5, 6)}
"""


def tuple_intersection(tuples, tuples2):
    """
    :param tuples: tuple list
    :param tuples2: tuple list
    :return: tuple intersection irrespective of their order
    """
    intersection = set()
    for tuple1 in tuples:
        for tuple2 in tuples2:
            if tuple1 == tuple2:
                intersection.add(tuple1)
    return intersection




--------------------------------------------------Mbpp/474--------------------------------------------------

<s> """
Write a function to replace characters in a string.
assert replace_char("polygon",'y','l')==("pollgon")
"""


def replace_char(string, old_char, new_char):
    """
    Replace characters in a string.
    assert replace_char("polygon",'y','l')==("pollgon")
    """
    return string.replace(old_char, new_char)




--------------------------------------------------Mbpp/475--------------------------------------------------

<s> """
Write a function to sort a dictionary by value.
assert sort_counter({'Math':81, 'Physics':83, 'Chemistry':87})==[('Chemistry', 87), ('Physics', 83), ('Math', 81)]
"""


def sort_counter(d):
    return sorted(d.items(), key=lambda x: x[1], reverse=True)




--------------------------------------------------Mbpp/476--------------------------------------------------

<s> """
Write a python function to find the sum of the largest and smallest value in a given array.
assert big_sum([1,2,3]) == 4
"""


def big_sum(array):
    return max(array) + min(array)




--------------------------------------------------Mbpp/477--------------------------------------------------

<s> """
Write a python function to convert the given string to lower case.
assert is_lower("InValid") == "invalid"
"""


def is_lower(string):
    return string.lower()




--------------------------------------------------Mbpp/478--------------------------------------------------

<s> """
Write a function to remove lowercase substrings from a given string.
assert remove_lowercase("PYTHon")==('PYTH')
"""


def remove_lowercase(string):
    """
    Write a function to remove lowercase substrings from a given string.
    assert remove_lowercase("PYTHon")==('PYTH')
    """
    if not string:
        return string
    if string[0].islower():
        return remove_lowercase(string[1:])
    else:
        return string[0] + remove_lowercase(string[1:])




--------------------------------------------------Mbpp/479--------------------------------------------------

<s> """
Write a python function to find the first digit of a given number.
assert first_Digit(123) == 1
"""


def first_digit(num):
    return int(str(num)[0])




--------------------------------------------------Mbpp/554--------------------------------------------------

<s> """
Write a python function which takes a list of integers and only returns the odd ones.
assert Split([1,2,3,4,5,6]) == [1,3,5]
"""

def Split(list):
    odd = []
    for i in list:
        if i % 2 != 0:
            odd.append(i)
    return odd



--------------------------------------------------Mbpp/555--------------------------------------------------

<s> """
Write a python function to find the difference between the sum of cubes of the first n natural numbers and the sum of the first n natural numbers.
assert difference(3) == 30
"""


def difference(n):
    """
    >>> difference(3)
    30
    """
    cubes = [i**3 for i in range(1, n+1)]
    natural_numbers = [i for i in range(1, n+1)]
    return sum(cubes) - sum(natural_numbers)




--------------------------------------------------Mbpp/556--------------------------------------------------

<s> """
Write a python function to count the number of pairs whose xor value is odd.
assert find_Odd_Pair([5,4,7,2,1],5) == 6
"""


def find_Odd_Pair(arr, n):
    count = 0
    for i in range(n):
        for j in range(i+1, n):
            if (arr[i] ^ arr[j]) % 2 == 1:
                count += 1
    return count




--------------------------------------------------Mbpp/557--------------------------------------------------

<s> """
Write a function to toggle the case of all characters in a string.
assert toggle_string("Python")==("pYTHON")
"""


def toggle_string(string):
    """
    :param string: string to toggle the case of all characters in a string.
    :return: string with toggled case of all characters.
    """
    return string.swapcase()




--------------------------------------------------Mbpp/558--------------------------------------------------

<s> """
Write a python function to find the sum of the per-digit difference between two integers.
assert digit_distance_nums(1,2) == 1
"""


def digit_distance_nums(num1, num2):
    """
    :param num1: int
    :param num2: int
    :return: int
    """
    num1_list = list(str(num1))
    num2_list = list(str(num2))
    if len(num1_list) != len(num2_list):
        return 0
    else:
        return sum([abs(int(num1_list[i]) - int(num2_list[i])) for i in range(len(num1_list))])




--------------------------------------------------Mbpp/559--------------------------------------------------

<s> """
Write a function to find the sum of the largest contiguous sublist in the given list.
assert max_sub_array_sum([-2, -3, 4, -1, -2, 1, 5, -3], 8) == 7
"""


def max_sub_array_sum(lst, k):
    """
    :param lst: list of integers
    :param k: integer
    :return: sum of the largest contiguous sublist in the given list
    """
    if len(lst) < k:
        return 0
    if k == 1:
        return max(lst)
    max_sum = 0
    for i in range(len(lst) - k + 1):
        max_sum = max(max_sum, sum(lst[i:i + k]))
    return max_sum




--------------------------------------------------Mbpp/560--------------------------------------------------

<s> """
Write a function to find the union of the elements of two given tuples and output them in sorted order.
assert union_elements((3, 4, 5, 6),(5, 7, 4, 10) ) == (3, 4, 5, 6, 7, 10)
"""


def union_elements(t1, t2):
    """
    Write a function to find the union of the elements of two given tuples and output them in sorted order.
    assert union_elements((3, 4, 5, 6),(5, 7, 4, 10) ) == (3, 4, 5, 6, 7, 10)
    """
    return sorted(set(t1) | set(t2))




--------------------------------------------------Mbpp/562--------------------------------------------------

<s> """
Write a python function to find the length of the longest sublists.
assert Find_Max_Length([[1],[1,4],[5,6,7,8]]) == 4
"""


def Find_Max_Length(list_of_lists):
    """
    Write a python function to find the length of the longest sublists.
    assert Find_Max_Length([[1],[1,4],[5,6,7,8]]) == 4
    """
    max_length = 0
    for sublist in list_of_lists:
        if len(sublist) > max_length:
            max_length = len(sublist)
    return max_length




--------------------------------------------------Mbpp/563--------------------------------------------------

<s> """
Write a function to extract values between quotation marks from a string.
assert extract_values('"Python", "PHP", "Java"')==['Python', 'PHP', 'Java']
"""


def extract_values(string):
    """
    Write a function to extract values between quotation marks from a string.
    assert extract_values('"Python", "PHP", "Java"')==['Python', 'PHP', 'Java']
    """
    return [x.strip('"') for x in string.split(',')]




--------------------------------------------------Mbpp/564--------------------------------------------------

<s> """
Write a python function which takes a list of integers and counts the number of possible unordered pairs where both elements are unequal.
assert count_Pairs([1,2,1],3) == 2
"""


def count_Pairs(lst, n):
    count = 0
    for i in range(n):
        for j in range(i+1, n):
            if lst[i] != lst[j]:
                count += 1
    return count




--------------------------------------------------Mbpp/565--------------------------------------------------

<s> """
Write a python function to split a string into characters.
assert split('python') == ['p','y','t','h','o','n']
"""


def split(string):
    return list(string)




--------------------------------------------------Mbpp/566--------------------------------------------------

<s> """
Write a function to get the sum of the digits of a non-negative integer.
assert sum_digits(345)==12
"""


def sum_digits(n):
    """
    :type n: int
    :rtype: int
    """
    if n < 10:
        return n
    else:
        return sum_digits(n // 10) + n % 10




--------------------------------------------------Mbpp/567--------------------------------------------------

<s> """
Write a function to check whether a specified list is sorted or not.
assert issort_list([1,2,4,6,8,10,12,14,16,17])==True
"""


def issort_list(list_):
    for i in range(len(list_) - 1):
        if list_[i] > list_[i + 1]:
            return False
    return True




--------------------------------------------------Mbpp/568--------------------------------------------------

<s> """
Write a function to create a list of N empty dictionaries.
assert empty_list(5)==[{},{},{},{},{}]
"""


def empty_list(n):
    """
    Create a list of N empty dictionaries.
    :param n: number of dictionaries
    :return: list of N empty dictionaries
    """
    return [{} for _ in range(n)]




--------------------------------------------------Mbpp/569--------------------------------------------------

<s> """
Write a function to sort each sublist of strings in a given list of lists.
assert sort_sublists([['green', 'orange'], ['black', 'white'], ['white', 'black', 'orange']])==[['green', 'orange'], ['black', 'white'], ['black', 'orange', 'white']]
"""


def sort_sublists(lists):
    for i in range(len(lists)):
        lists[i].sort()
    return lists




--------------------------------------------------Mbpp/572--------------------------------------------------

<s> """
Write a python function to remove duplicate numbers from a given number of lists.
assert two_unique_nums([1,2,3,2,3,4,5]) == [1, 4, 5]
"""


def two_unique_nums(lists):
    """
    :param lists: list of lists
    :return: list of unique numbers
    """
    result = []
    for list_ in lists:
        for num in list_:
            if num not in result:
                result.append(num)
    return result




--------------------------------------------------Mbpp/573--------------------------------------------------

<s> """
Write a python function to calculate the product of the unique numbers in a given list.
assert unique_product([10, 20, 30, 40, 20, 50, 60, 40]) ==  720000000
"""


def unique_product(nums):
    """
    :param nums: list of numbers
    :return: product of unique numbers
    """
    nums = sorted(nums)
    product = 1
    for i in range(len(nums)):
        if i == 0:
            product *= nums[i]
        elif nums[i] != nums[i - 1]:
            product *= nums[i]
    return product




--------------------------------------------------Mbpp/574--------------------------------------------------

<s> """
Write a function to find the surface area of a cylinder.
assert surfacearea_cylinder(10,5)==942.45
"""


def surfacearea_cylinder(radius, height):
    """
    Write a function to find the surface area of a cylinder.
    assert surfacearea_cylinder(10,5)==942.45
    """
    return 2 * (radius * radius * height + 2 * radius * height + 2 * radius * math.pi)




--------------------------------------------------Mbpp/576--------------------------------------------------

<s> """
Write a python function to check whether a list is sublist of another or not.
assert is_Sub_Array([1,4,3,5],[1,2]) == False
"""


def is_Sub_Array(list1, list2):
    if len(list1) > len(list2):
        return False
    else:
        for i in range(len(list2)):
            if list1[i] != list2[i]:
                return False
        return True




--------------------------------------------------Mbpp/577--------------------------------------------------

<s> """
Write a python function to find the last digit in factorial of a given number.
assert last_Digit_Factorial(4) == 4
"""


def last_Digit_Factorial(n):
    """
    :param n: int
    :return: int
    """
    if n == 0:
        return 1
    else:
        return n * last_Digit_Factorial(n - 1) % 10




--------------------------------------------------Mbpp/578--------------------------------------------------

<s> """
Write a function to interleave 3 lists of the same length into a single flat list.
assert interleave_lists([1,2,3,4,5,6,7],[10,20,30,40,50,60,70],[100,200,300,400,500,600,700])==[1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700]
"""


def interleave_lists(list1, list2, list3):
    """
    Write a function to interleave 3 lists of the same length into a single flat list.
    assert interleave_lists([1,2,3,4,5,6,7],[10,20,30,40,50,60,70],[100,200,300,400,500,600,700])==[1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700]
    """
    if len(list1) != len(list2) or len(list1) != len(list3):
        raise ValueError("Lists must be of the same length")
    else:
        interleaved_list = []
        for i in range(len(list1)):
            interleaved_list.append(list1[i])
            interleaved_list.append(list2[i])
            interleaved_list.append(list3[i])
        return interleaved_list




--------------------------------------------------Mbpp/579--------------------------------------------------

<s> """
Write a function to find the dissimilar elements in the given two tuples.
assert find_dissimilar((3, 4, 5, 6), (5, 7, 4, 10)) == (3, 6, 7, 10)
"""


def find_dissimilar(t1, t2):
    """
    :param t1: tuple
    :param t2: tuple
    :return: tuple
    """
    return tuple(set(t1) ^ set(t2))




--------------------------------------------------Mbpp/580--------------------------------------------------

<s> """
Write a function to remove uneven elements in the nested mixed tuple.
assert extract_even((4, 5, (7, 6, (2, 4)), 6, 8)) == (4, (6, (2, 4)), 6, 8)
"""


def extract_even(t):
    if isinstance(t, tuple):
        return tuple(extract_even(x) for x in t if x % 2 == 0)
    else:
        return t




--------------------------------------------------Mbpp/581--------------------------------------------------

<s> """
Write a python function to find the surface area of a square pyramid with a given base edge and height.
assert surface_Area(3,4) == 33
"""


def surface_Area(baseEdge, height):
    return (baseEdge * baseEdge + baseEdge * height) / 2




--------------------------------------------------Mbpp/582--------------------------------------------------

<s> """
Write a function to check if a dictionary is empty
assert my_dict({10})==False
"""

def my_dict(dictionary):
    if dictionary:
        return False
    else:
        return True



--------------------------------------------------Mbpp/583--------------------------------------------------

<s> """
Write a function which returns nth catalan number.
assert catalan_number(10)==16796
"""


def catalan_number(n):
    """
    Write a function which returns nth catalan number.
    assert catalan_number(10)==16796
    """
    if n == 1:
        return 1
    if n == 2:
        return 2
    if n == 3:
        return 5
    if n == 4:
        return 14
    if n == 5:
        return 42
    if n == 6:
        return 132
    if n == 7:
        return 429
    if n == 8:
        return 1430
    if n == 9:
        return 4862
    if n == 10:
        return 16796
    if n == 11:
        return 58786
    if n == 12:
        return 208012
    if n == 13:
        return 742900
    if n == 14:
        return 2674440
    if n == 15:
        return 9694845
    if n == 16:
        return 35357670
    if n == 17:
        return 129644790
    if n == 18:
        return 477638700
    if n == 19:
        return 1767263190
    if n == 20:
        return 6547290784
    if n == 21:
        return 24477422190
    if n == 22:
        return 87178291200

--------------------------------------------------Mbpp/585--------------------------------------------------

<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""


def expensive_items(dataset, n):
    """
    :param dataset: list of dictionaries
    :param n: number of items to return
    :return:<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""
<s> """
Write a function to find the n most expensive items in a given dataset.
assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]
"""


def expensive_items(dataset, n):
    """
    :param dataset: list of dictionaries
    :param n: number of items to return
    :return: list of n most expensive items
    """
    dataset.sort(key=lambda x: x['price'], reverse=True)
    return dataset[:n]




--------------------------------------------------Mbpp/586--------------------------------------------------

<s> """
Write a python function to split a list at the nth element and add the first part to the end.
assert split_Arr([12,10,5,6,52,36],2) == [5,6,52,36,12,10]
"""

def split_Arr(arr, n):
    return arr[n:] + arr[:n]



--------------------------------------------------Mbpp/587--------------------------------------------------

<s> """
Write a function to convert a list to a tuple.
assert list_tuple([5, 10, 7, 4, 15, 3])==(5, 10, 7, 4, 15, 3)
"""


def list_tuple(list_):
    return tuple(list_)




--------------------------------------------------Mbpp/588--------------------------------------------------

<s> """
Write a python function to find the difference between largest and smallest value in a given list.
assert big_diff([1,2,3,4]) == 3
"""


def big_diff(lst):
    return max(lst) - min(lst)




--------------------------------------------------Mbpp/589--------------------------------------------------

<s> """
Write a function to find perfect squares between two given numbers.
assert perfect_squares(1,30)==[1, 4, 9, 16, 25]
"""


def perfect_squares(a, b):
    """
    Write a function to find perfect squares between two given numbers.
    assert perfect_squares(1,30)==[1, 4, 9, 16, 25]
    """
    perfect_squares = []
    for i in range(a, b + 1):
        if i ** 0.5 == int(i ** 0.5):
            perfect_squares.append(i)
    return perfect_squares




--------------------------------------------------Mbpp/590--------------------------------------------------

<s> """
Write a function to convert polar coordinates to rectangular coordinates.
assert polar_rect(3,4)==((5.0, 0.9272952180016122), (-2+2.4492935982947064e-16j))
"""

def polar_rect(r,theta):
    x = r * math.cos(theta)
    y = r * math.sin(theta)
    return (x,y)



--------------------------------------------------Mbpp/591--------------------------------------------------

<s> """
Write a python function to interchange the first and last elements in a list.
assert swap_List([12, 35, 9, 56, 24]) == [24, 35, 9, 56, 12]
"""


def swap_List(lst):
    lst[0], lst[-1] = lst[-1], lst[0]
    return lst




--------------------------------------------------Mbpp/592--------------------------------------------------

<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""


def sum_Of_product(n):
    binomial_co_eff = [1, 2, 6, 12, 20, 30, 42, 56, 72, 90, 110, 132, 156, 182, 210, 240, <s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""
<s> """
Write a python function to find the sum of the product of consecutive binomial co-efficients.
assert sum_Of_product(3) == 15
"""


def sum_Of_product(n):
    binomial_co_eff = [1, 2, 6, 12, 20, 30, 42, 56, 72, 90, 110, 132, 156, 182, 210, 240, 272, 306, 342, 380, 420, 462, 506, 552, 600, 650, 704, 760, 816, 876, 938, 1000]
    return sum(binomial_co_eff[i] * binomial_co_eff[i + 1] for i in range(len(binomial_co_eff) - 1))




--------------------------------------------------Mbpp/593--------------------------------------------------

<s> """
Write a function to remove leading zeroes from an ip address.
assert removezero_ip("216.08.094.196")==('216.8.94.196')
"""


def removezero_ip(ip):
    """
    Write a function to remove leading zeroes from an ip address.
    assert removezero_ip("216.08.094.196")==('216.8.94.196')
    """
    ip_list = ip.split('.')
    for i in range(len(ip_list)):
        if ip_list[i] == '0':
            ip_list[i] = ''
        else:
            break
    return tuple(ip_list)




--------------------------------------------------Mbpp/594--------------------------------------------------

<s> """
Write a function to find the difference of the first even and first odd number of a given list.
assert diff_even_odd([1,3,5,7,4,1,6,8])==3
"""


def diff_even_odd(lst):
    """
    :param lst: list
    :return: int
    """
    lst.sort()
    return lst[0] + lst[1]




--------------------------------------------------Mbpp/595--------------------------------------------------

<s> """
Write a python function to count minimum number of swaps required to convert one binary number represented as a string to another.
assert min_Swaps("1101","1110") == 1
"""


def min_swaps(a, b):
    """
    :param a: binary number represented as a string
    :param b: binary number represented as a string
    :return: minimum number of swaps required to convert one binary number represented as a string to another
    """
    if len(a) != len(b):
        raise ValueError("a and b must have the same length")
    count = 0
    for i in range(len(a)):
        if a[i] != b[i]:
            count += 1
            a[i], b[i] = b[i], a[i]
    return count




--------------------------------------------------Mbpp/596--------------------------------------------------

<s> """
Write a function to find the size in bytes of the given tuple.
assert tuple_size(("A", 1, "B", 2, "C", 3) ) == sys.getsizeof(("A", 1, "B", 2, "C", 3))
"""


--------------------------------------------------Mbpp/597--------------------------------------------------

<s> """
Write a function to find kth element from the given two sorted arrays.
assert find_kth([2, 3, 6, 7, 9], [1, 4, 8, 10], 5) == 6
"""


def find_kth(arr1, arr2, k):
    """
    :param arr1: sorted array
    :param arr2: sorted array
    :param k: kth element
    :return: kth element
    """
    if not arr1 or not arr2:
        return None
    if k > len(arr1) + len(arr2):
        return None
    if k <= len(arr1):
        return arr1[k - 1]
    if k <= len(arr1) + len(arr2):
        return arr2[k - len(arr1) - 1]




--------------------------------------------------Mbpp/598--------------------------------------------------

<s> """
Write a function to check whether the given number is armstrong or not.
assert armstrong_number(153)==True
"""


def armstrong_number(n):
    """
    :param n: int
    :return: bool
    """
    if n < 0:
        return False
    if n == 0:
        return True
    if n == 1:
        return True
    if n == 2:
        return True
    if n == 3:
        return True
    if n == 4:
        return True
    if n == 5:
        return True
    if n == 6:
        return True
    if n == 7:
        return True
    if n == 8:
        return True
    if n == 9:
        return True
    if n == 10:
        return True
    if n == 11:
        return True
    if n == 12:
        return True
    if n == 13:
        return True
    if n == 14:
        return True
    if n == 15:
        return True
    if n == 16:
        return True
    if n == 17:
        return True
    if n == 18:
        return True
    if n == 19:
        return True
    if n == 20:
        return True

--------------------------------------------------Mbpp/599--------------------------------------------------

<s> """
Write a function to find sum and average of first n natural numbers.
assert sum_average(10)==(55, 5.5)
"""


def sum_average(n):
    """
    Write a function to find sum and average of first n natural numbers.
    assert sum_average(10)==(55, 5.5)
    """
    sum = 0
    for i in range(1, n + 1):
        sum += i
    return sum, sum / n




--------------------------------------------------Mbpp/600--------------------------------------------------

<s> """
Write a python function to check whether the given number is even or not.
assert is_Even(1) == False
"""


def is_even(num):
    if num % 2 == 0:
        return True
    else:
        return False




--------------------------------------------------Mbpp/602--------------------------------------------------

<s> """
Write a python function to find the first repeated character in a given string.
assert first_repeated_char("abcabc") == "a"
"""


def first_repeated_char(string):
    """
    Write a python function to find the first repeated character in a given string.
    assert first_repeated_char("abcabc") == "a"
    """
    for char in string:
        if string.count(char) > 1:
            return char
    return None




--------------------------------------------------Mbpp/603--------------------------------------------------

<s> """
Write a function to get all lucid numbers smaller than or equal to a given integer.
assert get_ludic(10) == [1, 2, 3, 5, 7]
"""


def get_lucid_numbers(number):
    """
    :param number: int
    :return: list
    """
    lucid_numbers = []
    lucid_numbers.append(1)
    lucid_numbers.append(2)
    lucid_numbers.append(3)
    lucid_numbers.append(5)
    lucid_numbers.append(7)
    for i in range(8, number + 1):
        if i % 2 == 0:
            lucid_numbers.append(i)
        else:
            lucid_numbers.append(lucid_numbers[i - 1] + lucid_numbers[i - 3])
    return lucid_numbers




--------------------------------------------------Mbpp/604--------------------------------------------------

<s> """
Write a function to reverse words seperated by spaces in a given string.
assert reverse_words("python program")==("program python")
"""


def reverse_words(string):
    """
    :param string: string to reverse
    :return: reversed string
    """
    return " ".join(string.split()[::-1])




--------------------------------------------------Mbpp/605--------------------------------------------------

<s> """
Write a function to check if the given integer is a prime number.
assert prime_num(13)==True
"""


def prime_num(num):
    if num == 1:
        return False
    for i in range(2, num):
        if num % i == 0:
            return False
    return True




--------------------------------------------------Mbpp/606--------------------------------------------------

<s> """
Write a function to convert degrees to radians.
assert radian_degree(90)==1.5707963267948966
"""


def radian_degree(degree):
    """
    Write a function to convert degrees to radians.
    assert radian_degree(90)==1.5707963267948966
    :param degree:
    :return:
    """
    return degree * (3.141592653589793 / 180)




--------------------------------------------------Mbpp/607--------------------------------------------------

<s> """
Write a function to search a string for a regex pattern. The function should return the matching subtring, a start index and an end index.
assert find_literals('The quick brown fox jumps over the lazy dog.', 'fox') == ('fox', 16, 19)
"""



--------------------------------------------------Mbpp/608--------------------------------------------------

<s> """
Write a python function to find nth bell number.
assert bell_Number(2) == 2
"""


def bell_Number(n):
    """
    Write a python function to find nth bell number.
    assert bell_Number(2) == 2
    """
    if n == 1:
        return 1
    if n == 2:
        return 2
    return bell_Number(n - 1) + bell_Number(n - 2)




--------------------------------------------------Mbpp/610--------------------------------------------------

<s> """
Write a python function which takes a list and returns a list with the same elements, but the k'th element removed.
assert remove_kth_element([1,1,2,3,4,4,5,1],3)==[1, 1, 3, 4, 4, 5, 1]
"""

def remove_kth_element(lst, k):
    return lst[:k-1] + lst[k:]



--------------------------------------------------Mbpp/611--------------------------------------------------

<s> """
Write a function which given a matrix represented as a list of lists returns the max of the n'th column.
assert max_of_nth([[5, 6, 7], [1, 3, 5], [8, 9, 19]], 2) == 19
"""


def max_of_nth(matrix, n):
    """
    :param matrix: list of lists
    :param n: int
    :return: int
    """
    return max(column[n] for column in matrix)




--------------------------------------------------Mbpp/612--------------------------------------------------

<s> """
Write a python function which takes a list of lists, where each sublist has two elements, and returns a list of two lists where the first list has the first element of each sublist and the second one has the second.
assert merge([['x', 'y'], ['a', 'b'], ['m', 'n']]) == [['x', 'a', 'm'], ['y', 'b', 'n']]
"""

def merge(l):
    return [list(zip(*l))[0], list(zip(*l))[1]]



--------------------------------------------------Mbpp/614--------------------------------------------------

<s> """
Write a function to find the cumulative sum of all the values that are present in the given tuple list.
assert cummulative_sum([(1, 3), (5, 6, 7), (2, 6)]) == 30
"""


def cummulative_sum(tuple_list):
    """
    :param tuple_list: tuple list
    :return: cummulative sum
    """
    return sum(sum(t) for t in tuple_list)




--------------------------------------------------Mbpp/615--------------------------------------------------

<s> """
Write a function which takes a tuple of tuples and returns the average value for each tuple as a list.
assert average_tuple(((10, 10, 10, 12), (30, 45, 56, 45), (81, 80, 39, 32), (1, 2, 3, 4)))==[30.5, 34.25, 27.0, 23.25]
"""

def average_tuple(tuple_of_tuples):
    return [sum(t)/len(t) for t in tuple_of_tuples]



--------------------------------------------------Mbpp/616--------------------------------------------------

<s> """
Write a function which takes two tuples of the same length and performs the element wise modulo.
assert tuple_modulo((10, 4, 5, 6), (5, 6, 7, 5)) == (0, 4, 5, 1)
"""


def tuple_modulo(t1, t2):
    return tuple(map(lambda x, y: x % y, t1, t2))




--------------------------------------------------Mbpp/618--------------------------------------------------

<s> """
Write a function to divide two lists element wise.
assert div_list([4,5,6],[1, 2, 3])==[4.0,2.5,2.0]
"""

def div_list(list1, list2):
    """
    Write a function to divide two lists element wise.
    assert div_list([4,5,6],[1, 2, 3])==[4.0,2.5,2.0]
    """
    if len(list1) != len(list2):
        raise ValueError("Lists must be of equal length")
    else:
        return [x/y for x, y in zip(list1, list2)]




--------------------------------------------------Mbpp/619--------------------------------------------------

<s> """
Write a function to move all the numbers to the end of the given string.
assert move_num('I1love143you55three3000thousand') == 'Iloveyouthreethousand1143553000'
"""


def move_num(string):
    """
    Write a function to move all the numbers to the end of the given string.
    assert move_num('I1love143you55three3000thousand') == 'Iloveyouthreethousand1143553000'
    """
    nums = []
    for i in string:
        if i.isdigit():
            nums.append(i)
    nums = ''.join(nums)
    string = string.replace(nums, '')
    string = string + nums
    return string




--------------------------------------------------Mbpp/620--------------------------------------------------

<s> """
Write a function to find the size of the largest subset of a list of numbers so that every pair is divisible.
assert largest_subset([ 1, 3, 6, 13, 17, 18 ]) == 4
"""


def largest_subset(nums):
    """
    :param nums: list of numbers
    :return: size of the largest subset so that every pair is divisible
    """
    if not nums:
        return 0

    nums.sort()
    max_size = 0
    for i in range(len(nums)):
        for j in range(i + 1, len(nums)):
            if nums[i] % nums[j] == 0 or nums[j] % nums[i] == 0:
                max_size = max(max_size, j - i + 1)

    return max_size




--------------------------------------------------Mbpp/622--------------------------------------------------

<s> """
Write a function to find the median of two sorted lists of same size.
assert get_median([1, 12, 15, 26, 38], [2, 13, 17, 30, 45], 5) == 16.0
"""


def get_median(list1, list2, size):
    """
    :param list1: sorted list
    :param list2: sorted list
    :param size: size of both lists
    :return: median of both lists
    """
    if size % 2 == 0:
        return (list1[size // 2 - 1] + list1[size // 2]) / 2
    else:
        return list1[size // 2]




--------------------------------------------------Mbpp/623--------------------------------------------------

<s> """
Write a function to compute the n-th power of each number in a list.
assert nth_nums([1, 2, 3, 4, 5, 6, 7, 8, 9, 10],2)==[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
"""


def nth_nums(nums, n):
    """
    :param nums: list of numbers
    :param n: power
    :return: list of numbers
    """
    return [num ** n for num in nums]




--------------------------------------------------Mbpp/624--------------------------------------------------

<s> """
Write a python function to convert a given string to uppercase.
assert is_upper("person") =="PERSON"
"""


def is_upper(string):
    """
    Write a python function to convert a given string to uppercase.
    assert is_upper("person") =="PERSON"
    """
    return string.upper()




--------------------------------------------------Mbpp/626--------------------------------------------------

<s> """
Write a python function to find the area of the largest triangle that can be inscribed in a semicircle with a given radius.
assert triangle_area(-1) == None
"""


def triangle_area(radius):
    if radius < 0:
        return None
    largest_area = 0
    for i in range(1, radius):
        area = (radius ** 2) / (4 * i)
        if area > largest_area:
            largest_area = area
    return largest_area




--------------------------------------------------Mbpp/628--------------------------------------------------

<s> """
Write a function to replace all spaces in the given string with '%20'.
assert replace_spaces("My Name is Dawood") == 'My%20Name%20is%20Dawood'
"""


def replace_spaces(string):
    """
    :type string: str
    :rtype: str
    """
    return string.replace(' ', '%20')




--------------------------------------------------Mbpp/629--------------------------------------------------

<s> """
Write a python function to find even numbers from a list of numbers.
assert Split([1,2,3,4,5]) == [2,4]
"""

def Split(nums):
    even_nums = []
    for num in nums:
        if num % 2 == 0:
            even_nums.append(num)
    return even_nums



--------------------------------------------------Mbpp/630--------------------------------------------------

<s> """
Write a function to extract all the adjacent coordinates of the given coordinate tuple.
assert get_coordinates((3, 4)) == [[2, 3], [2, 4], [2, 5], [3, 3], [3, 4], [3, 5], [4, 3], [4, 4], [4, 5]]
"""


def get_coordinates(coordinate):
    """
    Write a function to extract all the adjacent coordinates of the given coordinate tuple.
    assert get_coordinates((3, 4)) == [[2, 3], [2, 4], [2, 5], [3, 3], [3, 4], [3, 5], [4, 3], [4, 4], [4, 5]]
    """
    x, y = coordinate
    return [[x - 1, y - 1], [x - 1, y], [x - 1, y + 1], [x, y - 1], [x, y], [x, y + 1], [x + 1, y - 1], [x + 1, y], [x + 1, y + 1]]




--------------------------------------------------Mbpp/631--------------------------------------------------

<s> """
Write a function to replace whitespaces with an underscore and vice versa in a given string.
assert replace_spaces('Jumanji The Jungle') == 'Jumanji_The_Jungle'
"""


def replace_spaces(string):
    """
    Replace whitespaces with an underscore and vice versa in a given string.
    assert replace_spaces('Jumanji The Jungle') == 'Jumanji_The_Jungle'
    """
    return string.replace(' ', '_').replace('_', ' ')




--------------------------------------------------Mbpp/632--------------------------------------------------

<s> """
Write a python function to move all zeroes to the end of the given list.
assert move_zero([1,0,2,0,3,4]) == [1,2,3,4,0,0]
"""


def move_zero(lst):
    """
    :param lst: list
    :return: list
    """
    zero_index = []
    for i in range(len(lst)):
        if lst[i] == 0:
            zero_index.append(i)
    for i in zero_index:
        lst.pop(i)
    lst.extend([0] * len(zero_index))
    return lst




--------------------------------------------------Mbpp/633--------------------------------------------------

<s> """
Write a python function to find the sum of xor of all pairs of numbers in the given list.
assert pair_xor_Sum([5,9,7,6],4) == 47
"""


def pair_xor_Sum(arr, n):
    """
    :param arr: list of numbers
    :param n: length of list
    :return: sum of xor of all pairs of numbers in the given list
    """
    if n == 1:
        return 0
    if n == 2:
        return arr[0] ^ arr[1]
    if n == 3:
        return arr[0] ^ arr[1] ^ arr[2]
    if n == 4:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3]
    if n == 5:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4]
    if n == 6:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4] ^ arr[5]
    if n == 7:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4] ^ arr[5] ^ arr[6]
    if n == 8:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4] ^ arr[5] ^ arr[6] ^ arr[7]
    if n == 9:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4] ^ arr[5] ^ arr[6] ^ arr[7] ^ arr[8]
    if n == 10:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4] ^ arr[5] ^ arr[6] ^ arr[7] ^ arr[8] ^ arr[9]
    if n == 11:
        return arr[<s> """
Write a python function to find the sum of xor of all pairs of numbers in the given list.
assert pair_xor_Sum([5,9,7,6],4) == 47
"""


def pair_xor_Sum(arr, n):
    """
    :param arr: list of numbers
    :param n: length of list
    :return: sum of xor of all pairs of numbers in the given list
    """
    if n == 1:
        return 0
    if n == 2:
        return arr[0] ^ arr[1]
    if n == 3:
        return arr[0] ^ arr[1] ^ arr[2]
    if n == 4:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3]
    if n == 5:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4]
    if n == 6:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4] ^ arr[5]
    if n == 7:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4] ^ arr[5] ^ arr[6]
    if n == 8:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4] ^ arr[5] ^ arr[6] ^ arr[7]
    if n == 9:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4] ^ arr[5] ^ arr[6] ^ arr[7] ^ arr[8]
    if n == 10:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4] ^ arr[5] ^ arr[6] ^ arr[7] ^ arr[8] ^ arr[9]
    if n == 11:
        return arr[<s> """
Write a python function to find the sum of xor of all pairs of numbers in the given list.
assert pair_xor_Sum([5,9,7,6],4) == 47
"""


def pair_xor_Sum(arr, n):
    """
    :param arr: list of numbers
    :param n: length of list
    :return: sum of xor of all pairs of numbers in the given list
    """
    if n == 1:
        return 0
    if n == 2:
        return arr[0] ^ arr[1]
    if n == 3:
        return arr[0] ^ arr[1] ^ arr[2]
    if n == 4:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3]
    if n == 5:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4]
    if n == 6:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4] ^ arr[5]
    if n == 7:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4] ^ arr[5] ^ arr[6]
    if n == 8:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4] ^ arr[5] ^ arr[6] ^ arr[7]
    if n == 9:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4] ^ arr[5] ^ arr[6] ^ arr[7] ^ arr[8]
    if n == 10:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4] ^ arr[5] ^ arr[6] ^ arr[7] ^ arr[8] ^ arr[9]
    if n == 11:
        return arr[<s> """
Write a python function to find the sum of xor of all pairs of numbers in the given list.
assert pair_xor_Sum([5,9,7,6],4) == 47
"""


def pair_xor_Sum(arr, n):
    """
    :param arr: list of numbers
    :param n: length of list
    :return: sum of xor of all pairs of numbers in the given list
    """
    if n == 1:
        return 0
    if n == 2:
        return arr[0] ^ arr[1]
    if n == 3:
        return arr[0] ^ arr[1] ^ arr[2]
    if n == 4:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3]
    if n == 5:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4]
    if n == 6:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4] ^ arr[5]
    if n == 7:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4] ^ arr[5] ^ arr[6]
    if n == 8:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4] ^ arr[5] ^ arr[6] ^ arr[7]
    if n == 9:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4] ^ arr[5] ^ arr[6] ^ arr[7] ^ arr[8]
    if n == 10:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4] ^ arr[5] ^ arr[6] ^ arr[7] ^ arr[8] ^ arr[9]
    if n == 11:
        return arr[<s> """
Write a python function to find the sum of xor of all pairs of numbers in the given list.
assert pair_xor_Sum([5,9,7,6],4) == 47
"""


def pair_xor_Sum(arr, n):
    """
    :param arr: list of numbers
    :param n: length of list
    :return: sum of xor of all pairs of numbers in the given list
    """
    if n == 1:
        return 0
    if n == 2:
        return arr[0] ^ arr[1]
    if n == 3:
        return arr[0] ^ arr[1] ^ arr[2]
    if n == 4:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3]
    if n == 5:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4]
    if n == 6:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4] ^ arr[5]
    if n == 7:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4] ^ arr[5] ^ arr[6]
    if n == 8:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4] ^ arr[5] ^ arr[6] ^ arr[7]
    if n == 9:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4] ^ arr[5] ^ arr[6] ^ arr[7] ^ arr[8]
    if n == 10:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4] ^ arr[5] ^ arr[6] ^ arr[7] ^ arr[8] ^ arr[9]
    if n == 11:
        return arr[<s> """
Write a python function to find the sum of xor of all pairs of numbers in the given list.
assert pair_xor_Sum([5,9,7,6],4) == 47
"""


def pair_xor_Sum(arr, n):
    """
    :param arr: list of numbers
    :param n: length of list
    :return: sum of xor of all pairs of numbers in the given list
    """
    if n == 1:
        return 0
    if n == 2:
        return arr[0] ^ arr[1]
    if n == 3:
        return arr[0] ^ arr[1] ^ arr[2]
    if n == 4:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3]
    if n == 5:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4]
    if n == 6:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4] ^ arr[5]
    if n == 7:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4] ^ arr[5] ^ arr[6]
    if n == 8:
        return arr[0] ^ arr[1] ^ arr[2] ^ arr[3] ^ arr[4] ^ arr[5] ^ arr[6] ^ arr[7]
    if n == 9:
        return arr[0] ^ arr[1] ^ arr[2