task_id
stringlengths
6
8
text
stringlengths
368
1.62k
Mbpp/226
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a python function to remove the characters which have odd index values of a given string assert odd_values_string('abcdef') == 'ace' ``` ### Answer: Below is a Python script with a self-contained function...
Mbpp/227
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a function to find minimum of three numbers assert min_of_three(10,20,0)==0 ``` ### Answer: Below is a Python script with a self-contained function that solves the problem and passes corresponding tests: ...
Mbpp/230
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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") ``` ### Answer: B...
Mbpp/232
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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]) ``` #...
Mbpp/233
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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) ``` ### Answer: Below is a Python script with a self-containe...
Mbpp/234
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a function to find the volume of a cube given its side length assert volume_cube(3)==27 ``` ### Answer: Below is a Python script with a self-contained function that solves the problem and passes correspon...
Mbpp/235
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a python function to set all even bits of a given number assert even_bit_set_number(10) == 10 ``` ### Answer: Below is a Python script with a self-contained function that solves the problem and passes cor...
Mbpp/237
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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)] )...
Mbpp/238
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a python function to count the number of non-empty substrings of a given string assert number_of_substrings("abc") == 6 ``` ### Answer: Below is a Python script with a self-contained function that solves ...
Mbpp/239
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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 e...
Mbpp/240
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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] `...
Mbpp/242
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a function to count the total number of characters in a string assert count_charac("python programming")==18 ``` ### Answer: Below is a Python script with a self-contained function that solves the problem...
Mbpp/244
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a python function to find the next perfect square greater than a given number assert next_Perfect_Square(35) == 36 ``` ### Answer: Below is a Python script with a self-contained function that solves the p...
Mbpp/245
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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, ...
Mbpp/247
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a function to find the length of the longest palindromic subsequence in the given string assert lps("TENS FOR TENS") == 5 ``` ### Answer: Below is a Python script with a self-contained function that solve...
Mbpp/250
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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 ``` ### Answer: Below is a Pyt...
Mbpp/251
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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', '...
Mbpp/252
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a python function to convert complex numbers to polar coordinates assert convert(1) == (1.0, 0.0) ``` ### Answer: Below is a Python script with a self-contained function that solves the problem and passes...
Mbpp/253
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a python function that returns the number of integer elements in a given list assert count_integer([1,2,'abc',1.2]) == 2 ``` ### Answer: Below is a Python script with a self-contained function that solves...
Mbpp/255
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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( ...
Mbpp/256
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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 ``` ### Answer: Below is a Python scr...
Mbpp/257
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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) ``` ### Answer: Below is a Python script with a self-contained...
Mbpp/259
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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)) ``` ### Answer: Below is a Py...
Mbpp/260
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a function to find the nth newman–shanks–williams prime number assert newman_prime(3) == 7 ``` ### Answer: Below is a Python script with a self-contained function that solves the problem and passes corres...
Mbpp/261
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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) ``` ### Answer: B...
Mbpp/262
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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_p...
Mbpp/264
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a function to calculate a dog's age in dog's years assert dog_age(12)==61 ``` ### Answer: Below is a Python script with a self-contained function that solves the problem and passes corresponding tests: ``...
Mbpp/265
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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', ...
Mbpp/266
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a function to find the lateral surface area of a cube given its side length assert lateralsurface_cube(5)==100 ``` ### Answer: Below is a Python script with a self-contained function that solves the probl...
Mbpp/267
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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 ``` ### Answer: Below is a Python script with a self-contained...
Mbpp/268
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a function to find the n'th star number assert find_star_num(3) == 37 ``` ### Answer: Below is a Python script with a self-contained function that solves the problem and passes corresponding tests: ```pyt...
Mbpp/269
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a function to find the ascii value of a character assert ascii_value('A')==65 ``` ### Answer: Below is a Python script with a self-contained function that solves the problem and passes corresponding tests...
Mbpp/270
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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 ``` ### Answer: Below is a Python script with a self-contained func...
Mbpp/271
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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 ``` ### Answer: Below is a Python scr...
Mbpp/272
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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] ``` ### Ans...
Mbpp/273
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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) ...
Mbpp/274
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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 ``` ### Answer: Below is a Python script with a self-conta...
Mbpp/276
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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) ``` ### Answer: Below is a Python scri...
Mbpp/277
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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,...
Mbpp/278
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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 ``` ### Answer: Below is a Python script with a s...
Mbpp/279
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a function to find the nth decagonal number assert is_num_decagonal(3) == 27 ``` ### Answer: Below is a Python script with a self-contained function that solves the problem and passes corresponding tests:...
Mbpp/280
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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 foun...
Mbpp/281
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a python function to check if the elements of a given list are unique or not assert all_unique([1,2,3]) == True ``` ### Answer: Below is a Python script with a self-contained function that solves the prob...
Mbpp/282
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a function to subtract two lists element-wise assert sub_list([1, 2, 3],[4,5,6])==[-3,-3,-3] ``` ### Answer: Below is a Python script with a self-contained function that solves the problem and passes corr...
Mbpp/283
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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 ``` ### Answer: Below is a Python...
Mbpp/284
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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 ``` ### Answer...
Mbpp/285
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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) ``` ### Answer: Below is a Python script with a self-c...
Mbpp/286
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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 ``` ###...
Mbpp/287
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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 ``` ### Answer: Below is a Python script with a self-contained function th...
Mbpp/290
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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]) ``` ### Answer: Below is a Python script with a self-con...
Mbpp/292
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a python function to find quotient of two numbers (rounded down to the nearest integer) assert find(10,3) == 3 ``` ### Answer: Below is a Python script with a self-contained function that solves the probl...
Mbpp/293
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a function to find the third side of a right angled triangle assert otherside_rightangle(7,8)==10.63014581273465 ``` ### Answer: Below is a Python script with a self-contained function that solves the pro...
Mbpp/294
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a function to find the maximum value in a given heterogeneous list assert max_val(['Python', 3, 2, 4, 5, 'version'])==5 ``` ### Answer: Below is a Python script with a self-contained function that solves ...
Mbpp/296
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a python function to count inversions in an array assert get_Inv_Count([1,20,6,4,5]) == 5 ``` ### Answer: Below is a Python script with a self-contained function that solves the problem and passes corresp...
Mbpp/297
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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] ``` ### Answer...
Mbpp/299
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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 Whe...
Mbpp/300
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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) ``` ### Answer: B...
Mbpp/301
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a function to find the depth of a dictionary assert dict_depth({'a':1, 'b': {'c': {'d': {}}}})==4 ``` ### Answer: Below is a Python script with a self-contained function that solves the problem and passes...
Mbpp/305
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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') ``` ### Answer: Below is a Python script with...
Mbpp/306
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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 assert max_sum_increasing_subseq([1, 101, 2, 3, 100, 4, ...
Mbpp/308
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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] ``` ### A...
Mbpp/309
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a python function to find the maximum of two numbers assert maximum(5,10) == 10 ``` ### Answer: Below is a Python script with a self-contained function that solves the problem and passes corresponding tes...
Mbpp/310
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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') ``` ### Answer: Below is a Python script with a self-conta...
Mbpp/311
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a python function to set the left most unset bit assert set_left_most_unset_bit(10) == 14 ``` ### Answer: Below is a Python script with a self-contained function that solves the problem and passes corresp...
Mbpp/312
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a function to find the volume of a cone assert math.isclose(volume_cone(5,12), 314.15926535897927, rel_tol=0.001) ``` ### Answer: Below is a Python script with a self-contained function that solves the pr...
Mbpp/388
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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 ``` ### Answer: Below is a Python script with a self-contained function that solves the ...
Mbpp/389
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a function to find the n'th lucas number assert find_lucas(9) == 76 ``` ### Answer: Below is a Python script with a self-contained function that solves the problem and passes corresponding tests: ```pytho...
Mbpp/390
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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'] ``` ### Answer: Below is a Python script with a self...
Mbpp/391
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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, ...
Mbpp/392
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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 ``` ### Answer: Below is a Python script with a se...
Mbpp/394
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a function to check if given tuple contains no duplicates assert check_distinct((1, 4, 5, 6, 1, 4)) == False ``` ### Answer: Below is a Python script with a self-contained function that solves the problem...
Mbpp/395
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a python function to find the first non-repeated character in a given string assert first_non_repeating_character("abcabc") == None ``` ### Answer: Below is a Python script with a self-contained function ...
Mbpp/397
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a function to find the median of three numbers assert median_numbers(25,55,65)==55.0 ``` ### Answer: Below is a Python script with a self-contained function that solves the problem and passes correspondin...
Mbpp/398
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a function to compute the sum of digits of each number of a given list assert sum_of_digits([10,2,56])==14 ``` ### Answer: Below is a Python script with a self-contained function that solves the problem a...
Mbpp/404
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a python function to find the minimum of two numbers assert minimum(1,2) == 1 ``` ### Answer: Below is a Python script with a self-contained function that solves the problem and passes corresponding tests...
Mbpp/405
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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 ``` ### Answer: Below is a Python script with a self-contained ...
Mbpp/406
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a python function to find whether the parity of a given number is odd assert find_Parity(12) == False ``` ### Answer: Below is a Python script with a self-contained function that solves the problem and pa...
Mbpp/409
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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 ``` ### Answer: Below is a Python script with a self-cont...
Mbpp/410
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a function to find the minimum value in a given heterogeneous list assert min_val(['Python', 3, 2, 4, 5, 'version'])==2 ``` ### Answer: Below is a Python script with a self-contained function that solves ...
Mbpp/412
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a python function to remove odd numbers from a given list assert remove_odd([1,2,3]) == [2] ``` ### Answer: Below is a Python script with a self-contained function that solves the problem and passes corre...
Mbpp/413
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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)==[...
Mbpp/414
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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 ``` ### Answer: Below is a Python script with a self-contained fun...
Mbpp/415
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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) ``` ### Answer: Below is a Python script with a self-contained function ...
Mbpp/418
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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'] ``` ### Answer: Below is a Python script with a self-contained funct...
Mbpp/419
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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]...
Mbpp/420
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a python function to find the cube sum of first n even natural numbers assert cube_Sum(2) == 72 ``` ### Answer: Below is a Python script with a self-contained function that solves the problem and passes c...
Mbpp/421
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a function to concatenate each element of tuple by the delimiter assert concatenate_tuple(("ID", "is", 4, "UTS") ) == 'ID-is-4-UTS' ``` ### Answer: Below is a Python script with a self-contained function ...
Mbpp/422
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a python function to find the average of cubes of first n natural numbers assert find_Average_Of_Cube(2) == 4.5 ``` ### Answer: Below is a Python script with a self-contained function that solves the prob...
Mbpp/424
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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'] ``` ### Answer: Below is a Python script with a self-co...
Mbpp/425
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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 ``` ### Answer: Below is a Python script with a self-con...
Mbpp/426
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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] ``` ### Answer: Below is a Python script with a self-contained function that solves the problem and ...
Mbpp/427
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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' ``` ### Answer: Below is a Python script with a self-contained function that ...
Mbpp/428
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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] ``` ### Answer: Below is a Python script with a self-...
Mbpp/429
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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) ``` ### Answer: Below is a Python script with a self-contained fun...
Mbpp/430
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a function to find the directrix of a parabola assert parabola_directrix(5,3,2)==-198 ``` ### Answer: Below is a Python script with a self-contained function that solves the problem and passes correspondi...
Mbpp/432
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a function to find the median length of a trapezium assert median_trapezium(15,25,35)==20 ``` ### Answer: Below is a Python script with a self-contained function that solves the problem and passes corresp...
Mbpp/433
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` 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 ``` ### Answer: Below is a Python script with a self-contai...
Mbpp/435
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a python function to find the last digit of a given number assert last_Digit(123) == 3 ``` ### Answer: Below is a Python script with a self-contained function that solves the problem and passes correspond...
Mbpp/436
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a python function to return the negative numbers in a list assert neg_nos([-1,4,5,-6]) == [-1,-6] ``` ### Answer: Below is a Python script with a self-contained function that solves the problem and passes...
Mbpp/437
Please provide a self-contained Python script that solves the following problem in a markdown code block: ``` Write a function to remove odd characters in a string assert remove_odd("python")==("yhn") ``` ### Answer: Below is a Python script with a self-contained function that solves the problem and passes correspondin...