question
stringlengths 104
2.09k
| test_list
listlengths 3
3
| test_time_limit
int64 1
1
| test_method
stringclasses 1
value | prefix
stringclasses 1
value |
|---|---|---|---|---|
Write a python function to count numbers whose oth and nth bits are set.
Your code should pass the test:
assert count_Num(2) == 1
|
[
"assert count_Num(2) == 1",
"assert count_Num(3) == 2",
"assert count_Num(1) == 1"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a python function to find the sum of fourth power of n natural numbers.
Your code should pass the test:
assert fourth_Power_Sum(2) == 17
|
[
"assert fourth_Power_Sum(2) == 17",
"assert fourth_Power_Sum(4) == 354",
"assert fourth_Power_Sum(6) == 2275"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to perform the concatenation of two string tuples.
Your code should pass the test:
assert concatenate_strings(("Manjeet", "Nikhil", "Akshat"), (" Singh", " Meherwal", " Garg")) == ('Manjeet Singh', 'Nikhil Meherwal', 'Akshat Garg')
|
[
"assert concatenate_strings((\"Manjeet\", \"Nikhil\", \"Akshat\"), (\" Singh\", \" Meherwal\", \" Garg\")) == ('Manjeet Singh', 'Nikhil Meherwal', 'Akshat Garg')",
"assert concatenate_strings((\"Shaik\", \"Ayesha\", \"Sanya\"), (\" Dawood\", \" Begum\", \" Singh\")) == ('Shaik Dawood', 'Ayesha Begum', 'Sanya Singh')",
"assert concatenate_strings((\"Harpreet\", \"Priyanka\", \"Muskan\"), (\"Kour\", \" Agarwal\", \"Sethi\")) == ('HarpreetKour', 'Priyanka Agarwal', 'MuskanSethi')"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to convert radians to degrees.
Your code should pass the test:
assert degree_radian(90)==5156.620156177409
|
[
"assert degree_radian(90)==5156.620156177409",
"assert degree_radian(60)==3437.746770784939",
"assert degree_radian(120)==6875.493541569878"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to decode a run-length encoded given list.
Your code should pass the test:
assert decode_list([[2, 1], 2, 3, [2, 4], 5,1])==[1,1,2,3,4,4,5,1]
|
[
"assert decode_list([[2, 1], 2, 3, [2, 4], 5,1])==[1,1,2,3,4,4,5,1]",
"assert decode_list(['a', 'u', 't', 'o', 'm', 'a', 't', 'i', 'c', 'a', [2, 'l'], 'y'])==['a', 'u', 't', 'o', 'm', 'a', 't', 'i', 'c', 'a', 'l', 'l', 'y']",
"assert decode_list(['p', 'y', 't', 'h', 'o', 'n'])==['p', 'y', 't', 'h', 'o', 'n']"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to check if a nested list is a subset of another nested list.
Your code should pass the test:
assert check_subset_list([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14],[[12, 18, 23, 25, 45], [7, 11, 19, 24, 28], [1, 5, 8, 18, 15, 16]])==False
|
[
"assert check_subset_list([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14],[[12, 18, 23, 25, 45], [7, 11, 19, 24, 28], [1, 5, 8, 18, 15, 16]])==False",
"assert check_subset_list([[2, 3, 1], [4, 5], [6, 8]],[[4, 5], [6, 8]])==True",
"assert check_subset_list([['a', 'b'], ['e'], ['c', 'd']],[['g']])==False"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a python function to find the first repeated character in a given string.
Your code should pass the test:
assert first_Repeated_Char("Google") == "o"
|
[
"assert first_Repeated_Char(\"Google\") == \"o\"",
"assert first_Repeated_Char(\"data\") == \"a\"",
"assert first_Repeated_Char(\"python\") == '\\0'"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a python function to find the minimum operations required to make two numbers equal.
Your code should pass the test:
assert min_Operations(2,4) == 1
|
[
"assert min_Operations(2,4) == 1",
"assert min_Operations(4,10) == 4",
"assert min_Operations(1,4) == 3"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to extract maximum and minimum k elements in the given tuple.
Your code should pass the test:
assert extract_min_max((5, 20, 3, 7, 6, 8), 2) == (3, 5, 8, 20)
|
[
"assert extract_min_max((5, 20, 3, 7, 6, 8), 2) == (3, 5, 8, 20)",
"assert extract_min_max((4, 5, 6, 1, 2, 7), 3) == (1, 2, 4, 5, 6, 7)",
"assert extract_min_max((2, 3, 4, 8, 9, 11, 7), 4) == (2, 3, 4, 7, 8, 9, 11)"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to replace maximum n occurrences of spaces, commas, or dots with a colon.
Your code should pass the test:
assert replace_max_specialchar('Python language, Programming language.',2)==('Python:language: Programming language.')
|
[
"assert replace_max_specialchar('Python language, Programming language.',2)==('Python:language: Programming language.')",
"assert replace_max_specialchar('a b c,d e f',3)==('a:b:c:d e f')",
"assert replace_max_specialchar('ram reshma,ram rahim',1)==('ram:reshma,ram rahim')"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a python function to find the first even number in a given list of numbers.
Your code should pass the test:
assert first_even ([1, 3, 5, 7, 4, 1, 6, 8]) == 4
|
[
"assert first_even ([1, 3, 5, 7, 4, 1, 6, 8]) == 4",
"assert first_even([2, 3, 4]) == 2",
"assert first_even([5, 6, 7]) == 6"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to check if all the elements in tuple have same data type or not.
Your code should pass the test:
assert check_type((5, 6, 7, 3, 5, 6) ) == True
|
[
"assert check_type((5, 6, 7, 3, 5, 6) ) == True",
"assert check_type((1, 2, \"4\") ) == False",
"assert check_type((3, 2, 1, 4, 5) ) == True"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to check for majority element in the given sorted array.
Your code should pass the test:
assert is_majority([1, 2, 3, 3, 3, 3, 10], 7, 3) == True
|
[
"assert is_majority([1, 2, 3, 3, 3, 3, 10], 7, 3) == True",
"assert is_majority([1, 1, 2, 4, 4, 4, 6, 6], 8, 4) == False",
"assert is_majority([1, 1, 1, 2, 2], 5, 1) == True"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a python function to count set bits of a given number.
Your code should pass the test:
assert count_Set_Bits(2) == 1
|
[
"assert count_Set_Bits(2) == 1",
"assert count_Set_Bits(4) == 1",
"assert count_Set_Bits(6) == 2"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a python function to find the minimum element in a sorted and rotated array.
Your code should pass the test:
assert find_Min([1,2,3,4,5],0,4) == 1
|
[
"assert find_Min([1,2,3,4,5],0,4) == 1",
"assert find_Min([4,6,8],0,2) == 4",
"assert find_Min([2,3,5,7,9],0,4) == 2"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a python function to remove the characters which have odd index values of a given string.
Your code should pass the test:
assert odd_values_string('abcdef') == 'ace'
|
[
"assert odd_values_string('abcdef') == 'ace'",
"assert odd_values_string('python') == 'pto'",
"assert odd_values_string('data') == 'dt'"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to find minimum of three numbers.
Your code should pass the test:
assert min_of_three(10,20,0)==0
|
[
"assert min_of_three(10,20,0)==0",
"assert min_of_three(19,15,18)==15",
"assert min_of_three(-10,-20,-30)==-30"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a python function to check whether all the bits are unset in the given range or not.
Your code should pass the test:
assert all_Bits_Set_In_The_Given_Range(4,1,2) == True
|
[
"assert all_Bits_Set_In_The_Given_Range(4,1,2) == True",
"assert all_Bits_Set_In_The_Given_Range(17,2,4) == True",
"assert all_Bits_Set_In_The_Given_Range(39,4,6) == False"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to re-arrange the elements of the given array so that all negative elements appear before positive ones.
Your code should pass the test:
assert re_arrange_array([-1, 2, -3, 4, 5, 6, -7, 8, 9], 9) == [-1, -3, -7, 4, 5, 6, 2, 8, 9]
|
[
"assert re_arrange_array([-1, 2, -3, 4, 5, 6, -7, 8, 9], 9) == [-1, -3, -7, 4, 5, 6, 2, 8, 9]",
"assert re_arrange_array([12, -14, -26, 13, 15], 5) == [-14, -26, 12, 13, 15]",
"assert re_arrange_array([10, 24, 36, -42, -39, -78, 85], 7) == [-42, -39, -78, 10, 24, 36, 85]"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to replace blank spaces with any character in a string.
Your code should pass the test:
assert replace_blank("hello people",'@')==("hello@people")
|
[
"assert replace_blank(\"hello people\",'@')==(\"hello@people\")",
"assert replace_blank(\"python program language\",'$')==(\"python$program$language\")",
"assert replace_blank(\"blank space\",\"-\")==(\"blank-space\")"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to find the maximum sum in the given right triangle of numbers.
Your code should pass the test:
assert max_sum([[1], [2,1], [3,3,2]], 3) == 6
|
[
"assert max_sum([[1], [2,1], [3,3,2]], 3) == 6",
"assert max_sum([[1], [1, 2], [4, 1, 12]], 3) == 15 ",
"assert max_sum([[2], [3,2], [13,23,12]], 3) == 28"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to get the n largest items from a dataset.
Your code should pass the test:
assert larg_nnum([10, 20, 50, 70, 90, 20, 50, 40, 60, 80, 100],2)==[100,90]
|
[
"assert larg_nnum([10, 20, 50, 70, 90, 20, 50, 40, 60, 80, 100],2)==[100,90]",
"assert larg_nnum([10, 20, 50, 70, 90, 20, 50, 40, 60, 80, 100],5)==[100,90,80,70,60]",
"assert larg_nnum([10, 20, 50, 70, 90, 20, 50, 40, 60, 80, 100],3)==[100,90,80]"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to find the lateral surface area of a cylinder.
Your code should pass the test:
assert lateralsuface_cylinder(10,5)==314.15000000000003
|
[
"assert lateralsuface_cylinder(10,5)==314.15000000000003",
"assert lateralsuface_cylinder(4,5)==125.66000000000001",
"assert lateralsuface_cylinder(4,10)==251.32000000000002"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to find the volume of a cube.
Your code should pass the test:
assert volume_cube(3)==27
|
[
"assert volume_cube(3)==27",
"assert volume_cube(2)==8",
"assert volume_cube(5)==125"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a python function to set all even bits of a given number.
Your code should pass the test:
assert even_bit_set_number(10) == 10
|
[
"assert even_bit_set_number(10) == 10",
"assert even_bit_set_number(20) == 30",
"assert even_bit_set_number(30) == 30"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a python function to count the maximum number of equilateral triangles that can be formed within a given equilateral triangle.
Your code should pass the test:
assert No_of_Triangle(4,2) == 7
|
[
"assert No_of_Triangle(4,2) == 7",
"assert No_of_Triangle(4,3) == 3",
"assert No_of_Triangle(1,3) == -1"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to check the occurrences of records which occur similar times in the given tuples.
Your code should pass the test:
assert check_occurences([(3, 1), (1, 3), (2, 5), (5, 2), (6, 3)] ) == {(1, 3): 2, (2, 5): 2, (3, 6): 1}
|
[
"assert check_occurences([(3, 1), (1, 3), (2, 5), (5, 2), (6, 3)] ) == {(1, 3): 2, (2, 5): 2, (3, 6): 1}",
"assert check_occurences([(4, 2), (2, 4), (3, 6), (6, 3), (7, 4)] ) == {(2, 4): 2, (3, 6): 2, (4, 7): 1}",
"assert check_occurences([(13, 2), (11, 23), (12, 25), (25, 12), (16, 23)] ) == {(2, 13): 1, (11, 23): 1, (12, 25): 2, (16, 23): 1}"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a python function to count number of non-empty substrings of a given string.
Your code should pass the test:
assert number_of_substrings("abc") == 6
|
[
"assert number_of_substrings(\"abc\") == 6",
"assert number_of_substrings(\"abcd\") == 10",
"assert number_of_substrings(\"abcde\") == 15"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to find the number of possible sequences of length n such that each of the next element is greater than or equal to twice of the previous element but less than or equal to m.
Your code should pass the test:
assert get_total_number_of_sequences(10, 4) == 4
|
[
"assert get_total_number_of_sequences(10, 4) == 4",
"assert get_total_number_of_sequences(5, 2) == 6",
"assert get_total_number_of_sequences(16, 3) == 84"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to replace the last element of the list with another list.
Your code should pass the test:
assert replace_list([1, 3, 5, 7, 9, 10],[2, 4, 6, 8])==[1, 3, 5, 7, 9, 2, 4, 6, 8]
|
[
"assert replace_list([1, 3, 5, 7, 9, 10],[2, 4, 6, 8])==[1, 3, 5, 7, 9, 2, 4, 6, 8]",
"assert replace_list([1,2,3,4,5],[5,6,7,8])==[1,2,3,4,5,6,7,8]",
"assert replace_list([\"red\",\"blue\",\"green\"],[\"yellow\"])==[\"red\",\"blue\",\"yellow\"]"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to generate a 3d array having each element as '*'.
Your code should pass the test:
assert array_3d(6,4,3)==[[['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*']], [['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*']], [['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*']]]
|
[
"assert array_3d(6,4,3)==[[['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*']], [['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*']], [['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*']]]",
"assert array_3d(5,3,4)==[[['*', '*', '*', '*', '*'], ['*', '*', '*', '*','*'], ['*', '*', '*', '*', '*']], [['*', '*', '*', '*', '*'],['*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*']], [['*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*']], [['*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*']]]",
"assert array_3d(1,2,3)==[[['*'],['*']],[['*'],['*']],[['*'],['*']]]"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to count total characters in a string.
Your code should pass the test:
assert count_charac("python programming")==18
|
[
"assert count_charac(\"python programming\")==18",
"assert count_charac(\"language\")==8",
"assert count_charac(\"words\")==5"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to sort the given list based on the occurrence of first element of tuples.
Your code should pass the test:
assert sort_on_occurence([(1, 'Jake'), (2, 'Bob'), (1, 'Cara')]) == [(1, 'Jake', 'Cara', 2), (2, 'Bob', 1)]
|
[
"assert sort_on_occurence([(1, 'Jake'), (2, 'Bob'), (1, 'Cara')]) == [(1, 'Jake', 'Cara', 2), (2, 'Bob', 1)]",
"assert sort_on_occurence([('b', 'ball'), ('a', 'arm'), ('b', 'b'), ('a', 'ant')]) == [('b', 'ball', 'b', 2), ('a', 'arm', 'ant', 2)]",
"assert sort_on_occurence([(2, 'Mark'), (3, 'Maze'), (2, 'Sara')]) == [(2, 'Mark', 'Sara', 2), (3, 'Maze', 1)]"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a python function to find the next perfect square greater than a given number.
Your code should pass the test:
assert next_Perfect_Square(35) == 36
|
[
"assert next_Perfect_Square(35) == 36",
"assert next_Perfect_Square(6) == 9",
"assert next_Perfect_Square(9) == 16"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to find the maximum sum of bi-tonic sub-sequence for the given array.
Your code should pass the test:
assert max_sum([1, 15, 51, 45, 33, 100, 12, 18, 9], 9) == 194
|
[
"assert max_sum([1, 15, 51, 45, 33, 100, 12, 18, 9], 9) == 194",
"assert max_sum([80, 60, 30, 40, 20, 10], 6) == 210",
"assert max_sum([2, 3 ,14, 16, 21, 23, 29, 30], 8) == 138"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function for computing square roots using the babylonian method.
Your code should pass the test:
assert babylonian_squareroot(10)==3.162277660168379
|
[
"assert babylonian_squareroot(10)==3.162277660168379",
"assert babylonian_squareroot(2)==1.414213562373095",
"assert babylonian_squareroot(9)==3.0"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to find the longest palindromic subsequence in the given string.
Your code should pass the test:
assert lps("TENS FOR TENS") == 5
|
[
"assert lps(\"TENS FOR TENS\") == 5 ",
"assert lps(\"CARDIO FOR CARDS\") == 7",
"assert lps(\"PART OF THE JOURNEY IS PART\") == 9 "
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to calculate the harmonic sum of n-1.
Your code should pass the test:
assert harmonic_sum(7) == 2.5928571428571425
|
[
"assert harmonic_sum(7) == 2.5928571428571425",
"assert harmonic_sum(4) == 2.083333333333333",
"assert harmonic_sum(19) == 3.547739657143682"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to find the intersection of two arrays using lambda function.
Your code should pass the test:
assert intersection_array([1, 2, 3, 5, 7, 8, 9, 10],[1, 2, 4, 8, 9])==[1, 2, 8, 9]
|
[
"assert intersection_array([1, 2, 3, 5, 7, 8, 9, 10],[1, 2, 4, 8, 9])==[1, 2, 8, 9]",
"assert intersection_array([1, 2, 3, 5, 7, 8, 9, 10],[3,5,7,9])==[3,5,7,9]",
"assert intersection_array([1, 2, 3, 5, 7, 8, 9, 10],[10,20,30,40])==[10]"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a python function to count the occcurences of an element in a tuple.
Your code should pass the test:
assert count_X((10, 8, 5, 2, 10, 15, 10, 8, 5, 8, 8, 2),4) == 0
|
[
"assert count_X((10, 8, 5, 2, 10, 15, 10, 8, 5, 8, 8, 2),4) == 0",
"assert count_X((10, 8, 5, 2, 10, 15, 10, 8, 5, 8, 8, 2),10) == 3",
"assert count_X((10, 8, 5, 2, 10, 15, 10, 8, 5, 8, 8, 2),8) == 4"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to insert an element before each element of a list.
Your code should pass the test:
assert insert_element(['Red', 'Green', 'Black'] ,'c')==['c', 'Red', 'c', 'Green', 'c', 'Black']
|
[
"assert insert_element(['Red', 'Green', 'Black'] ,'c')==['c', 'Red', 'c', 'Green', 'c', 'Black'] ",
"assert insert_element(['python', 'java'] ,'program')==['program', 'python', 'program', 'java'] ",
"assert insert_element(['happy', 'sad'] ,'laugh')==['laugh', 'happy', 'laugh', 'sad'] "
] | 1
|
function
|
Here is the completed code:
```python
|
Write a python function to convert complex numbers to polar coordinates.
Your code should pass the test:
assert convert(1) == (1.0, 0.0)
|
[
"assert convert(1) == (1.0, 0.0)",
"assert convert(4) == (4.0,0.0)",
"assert convert(5) == (5.0,0.0)"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a python function to count integers from a given list.
Your code should pass the test:
assert count_integer([1,2,'abc',1.2]) == 2
|
[
"assert count_integer([1,2,'abc',1.2]) == 2",
"assert count_integer([1,2,3]) == 3",
"assert count_integer([1,1.2,4,5.1]) == 2"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to find all words starting with 'a' or 'e' in a given string.
Your code should pass the test:
assert words_ae("python programe")==['ame']
|
[
"assert words_ae(\"python programe\")==['ame']",
"assert words_ae(\"python programe language\")==['ame','anguage']",
"assert words_ae(\"assert statement\")==['assert', 'atement']"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to choose specified number of colours from three different colours and generate all the combinations with repetitions.
Your code should pass the test:
assert combinations_colors( ["Red","Green","Blue"],1)==[('Red',), ('Green',), ('Blue',)]
|
[
"assert combinations_colors( [\"Red\",\"Green\",\"Blue\"],1)==[('Red',), ('Green',), ('Blue',)]",
"assert combinations_colors( [\"Red\",\"Green\",\"Blue\"],2)==[('Red', 'Red'), ('Red', 'Green'), ('Red', 'Blue'), ('Green', 'Green'), ('Green', 'Blue'), ('Blue', 'Blue')]",
"assert combinations_colors( [\"Red\",\"Green\",\"Blue\"],3)==[('Red', 'Red', 'Red'), ('Red', 'Red', 'Green'), ('Red', 'Red', 'Blue'), ('Red', 'Green', 'Green'), ('Red', 'Green', 'Blue'), ('Red', 'Blue', 'Blue'), ('Green', 'Green', 'Green'), ('Green', 'Green', 'Blue'), ('Green', 'Blue', 'Blue'), ('Blue', 'Blue', 'Blue')]"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a python function to count the number of prime numbers less than a given non-negative number.
Your code should pass the test:
assert count_Primes_nums(5) == 2
|
[
"assert count_Primes_nums(5) == 2",
"assert count_Primes_nums(10) == 4",
"assert count_Primes_nums(100) == 25"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to swap two numbers.
Your code should pass the test:
assert swap_numbers(10,20)==(20,10)
|
[
"assert swap_numbers(10,20)==(20,10)",
"assert swap_numbers(15,17)==(17,15)",
"assert swap_numbers(100,200)==(200,100)"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to find number of odd elements in the given list using lambda function.
Your code should pass the test:
assert count_odd([1, 2, 3, 5, 7, 8, 10])==4
|
[
"assert count_odd([1, 2, 3, 5, 7, 8, 10])==4",
"assert count_odd([10,15,14,13,-18,12,-20])==2",
"assert count_odd([1, 2, 4, 8, 9])==2"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to maximize the given two tuples.
Your code should pass the test:
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))
|
[
"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))",
"assert maximize_elements(((2, 4), (5, 6), (3, 10), (2, 11)), ((7, 8), (4, 10), (2, 2), (8, 4))) == ((7, 8), (5, 10), (3, 10), (8, 11))",
"assert maximize_elements(((3, 5), (6, 7), (4, 11), (3, 12)), ((8, 9), (5, 11), (3, 3), (9, 5))) == ((8, 9), (6, 11), (4, 11), (9, 12))"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to find the nth newman–shanks–williams prime number.
Your code should pass the test:
assert newman_prime(3) == 7
|
[
"assert newman_prime(3) == 7 ",
"assert newman_prime(4) == 17",
"assert newman_prime(5) == 41"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to perform mathematical division operation across the given tuples.
Your code should pass the test:
assert division_elements((10, 4, 6, 9),(5, 2, 3, 3)) == (2, 2, 2, 3)
|
[
"assert division_elements((10, 4, 6, 9),(5, 2, 3, 3)) == (2, 2, 2, 3)",
"assert division_elements((12, 6, 8, 16),(6, 3, 4, 4)) == (2, 2, 2, 4)",
"assert division_elements((20, 14, 36, 18),(5, 7, 6, 9)) == (4, 2, 6, 2)"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to split a given list into two parts where the length of the first part of the list is given.
Your code should pass the test:
assert split_two_parts([1,1,2,3,4,4,5,1],3)==([1, 1, 2], [3, 4, 4, 5, 1])
|
[
"assert split_two_parts([1,1,2,3,4,4,5,1],3)==([1, 1, 2], [3, 4, 4, 5, 1])",
"assert split_two_parts(['a', 'b', 'c', 'd'],2)==(['a', 'b'], ['c', 'd'])",
"assert split_two_parts(['p', 'y', 't', 'h', 'o', 'n'],4)==(['p', 'y', 't', 'h'], ['o', 'n'])"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to merge two dictionaries.
Your code should pass the test:
assert merge_dict({'a': 100, 'b': 200},{'x': 300, 'y': 200})=={'x': 300, 'y': 200, 'a': 100, 'b': 200}
|
[
"assert merge_dict({'a': 100, 'b': 200},{'x': 300, 'y': 200})=={'x': 300, 'y': 200, 'a': 100, 'b': 200}",
"assert merge_dict({'a':900,'b':900,'d':900},{'a':900,'b':900,'d':900})=={'a':900,'b':900,'d':900,'a':900,'b':900,'d':900}",
"assert merge_dict({'a':10,'b':20},{'x':30,'y':40})=={'x':30,'y':40,'a':10,'b':20}"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to calculate a dog's age in dog's years.
Your code should pass the test:
assert dog_age(12)==61
|
[
"assert dog_age(12)==61",
"assert dog_age(15)==73",
"assert dog_age(24)==109"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to split a list for every nth element.
Your code should pass the test:
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']]
|
[
"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']] ",
"assert list_split([1,2,3,4,5,6,7,8,9,10,11,12,13,14],3)==[[1,4,7,10,13], [2,5,8,11,14], [3,6,9,12]] ",
"assert list_split(['python','java','C','C++','DBMS','SQL'],2)==[['python', 'C', 'DBMS'], ['java', 'C++', 'SQL']] "
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to find the lateral surface area of a cube.
Your code should pass the test:
assert lateralsurface_cube(5)==100
|
[
"assert lateralsurface_cube(5)==100",
"assert lateralsurface_cube(9)==324",
"assert lateralsurface_cube(10)==400"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a python function to find the sum of squares of first n odd natural numbers.
Your code should pass the test:
assert square_Sum(2) == 10
|
[
"assert square_Sum(2) == 10",
"assert square_Sum(3) == 35",
"assert square_Sum(4) == 84"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to find the n'th star number.
Your code should pass the test:
assert find_star_num(3) == 37
|
[
"assert find_star_num(3) == 37",
"assert find_star_num(4) == 73",
"assert find_star_num(5) == 121"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to find the ascii value of a character.
Your code should pass the test:
assert ascii_value('A')==65
|
[
"assert ascii_value('A')==65",
"assert ascii_value('R')==82",
"assert ascii_value('S')==83"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a python function to find the sum of even numbers at even positions.
Your code should pass the test:
assert sum_even_and_even_index([5, 6, 12, 1, 18, 8],6) == 30
|
[
"assert sum_even_and_even_index([5, 6, 12, 1, 18, 8],6) == 30",
"assert sum_even_and_even_index([3, 20, 17, 9, 2, 10, 18, 13, 6, 18],10) == 26",
"assert sum_even_and_even_index([5, 6, 12, 1],4) == 12"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a python function to find the sum of fifth power of first n even natural numbers.
Your code should pass the test:
assert even_Power_Sum(2) == 1056
|
[
"assert even_Power_Sum(2) == 1056",
"assert even_Power_Sum(3) == 8832",
"assert even_Power_Sum(1) == 32"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to perfom the rear element extraction from list of tuples records.
Your code should pass the test:
assert rear_extract([(1, 'Rash', 21), (2, 'Varsha', 20), (3, 'Kil', 19)]) == [21, 20, 19]
|
[
"assert rear_extract([(1, 'Rash', 21), (2, 'Varsha', 20), (3, 'Kil', 19)]) == [21, 20, 19]",
"assert rear_extract([(1, 'Sai', 36), (2, 'Ayesha', 25), (3, 'Salman', 45)]) == [36, 25, 45]",
"assert rear_extract([(1, 'Sudeep', 14), (2, 'Vandana', 36), (3, 'Dawood', 56)]) == [14, 36, 56]"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to substract the contents of one tuple with corresponding index of other tuple.
Your code should pass the test:
assert substract_elements((10, 4, 5), (2, 5, 18)) == (8, -1, -13)
|
[
"assert substract_elements((10, 4, 5), (2, 5, 18)) == (8, -1, -13)",
"assert substract_elements((11, 2, 3), (24, 45 ,16)) == (-13, -43, -13)",
"assert substract_elements((7, 18, 9), (10, 11, 12)) == (-3, 7, -3)"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a python function to find sum of even index binomial coefficients.
Your code should pass the test:
assert even_binomial_Coeff_Sum(4) == 8
|
[
"assert even_binomial_Coeff_Sum(4) == 8",
"assert even_binomial_Coeff_Sum(6) == 32",
"assert even_binomial_Coeff_Sum(2) == 2"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a python function to find the position of the last removed element from the given array.
Your code should pass the test:
assert get_Position([2,5,4],3,2) == 2
|
[
"assert get_Position([2,5,4],3,2) == 2",
"assert get_Position([4,3],2,2) == 2",
"assert get_Position([1,2,3,4],4,1) == 4"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to find the volume of a cylinder.
Your code should pass the test:
assert volume_cylinder(10,5)==1570.7500000000002
|
[
"assert volume_cylinder(10,5)==1570.7500000000002",
"assert volume_cylinder(4,5)==251.32000000000002",
"assert volume_cylinder(4,10)==502.64000000000004"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to filter a dictionary based on values.
Your code should pass the test:
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}
|
[
"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}",
"assert dict_filter({'Cierra Vega': 175, 'Alden Cantrell': 180, 'Kierra Gentry': 165, 'Pierre Cox': 190},180)=={ 'Alden Cantrell': 180, 'Pierre Cox': 190}",
"assert dict_filter({'Cierra Vega': 175, 'Alden Cantrell': 180, 'Kierra Gentry': 165, 'Pierre Cox': 190},190)=={ 'Pierre Cox': 190}"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to find the element count that occurs before the record in the given tuple.
Your code should pass the test:
assert count_first_elements((1, 5, 7, (4, 6), 10) ) == 3
|
[
"assert count_first_elements((1, 5, 7, (4, 6), 10) ) == 3",
"assert count_first_elements((2, 9, (5, 7), 11) ) == 2",
"assert count_first_elements((11, 15, 5, 8, (2, 3), 8) ) == 4"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to find the nth decagonal number.
Your code should pass the test:
assert is_num_decagonal(3) == 27
|
[
"assert is_num_decagonal(3) == 27",
"assert is_num_decagonal(7) == 175",
"assert is_num_decagonal(10) == 370"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to search an element in the given array by using sequential search.
Your code should pass the test:
assert sequential_search([11,23,58,31,56,77,43,12,65,19],31) == (True, 3)
|
[
"assert sequential_search([11,23,58,31,56,77,43,12,65,19],31) == (True, 3)",
"assert sequential_search([12, 32, 45, 62, 35, 47, 44, 61],61) == (True, 7)",
"assert sequential_search([9, 10, 17, 19, 22, 39, 48, 56],48) == (True, 6)"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a python function to check if the elements of a given list are unique or not.
Your code should pass the test:
assert all_unique([1,2,3]) == True
|
[
"assert all_unique([1,2,3]) == True",
"assert all_unique([1,2,1,2]) == False",
"assert all_unique([1,2,3,4,5]) == True"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to substaract two lists using map and lambda function.
Your code should pass the test:
assert sub_list([1, 2, 3],[4,5,6])==[-3,-3,-3]
|
[
"assert sub_list([1, 2, 3],[4,5,6])==[-3,-3,-3]",
"assert sub_list([1,2],[3,4])==[-2,-2]",
"assert sub_list([90,120],[50,70])==[40,50]"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a python function to check whether the frequency of each digit is less than or equal to the digit itself.
Your code should pass the test:
assert validate(1234) == True
|
[
"assert validate(1234) == True",
"assert validate(51241) == False",
"assert validate(321) == True"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to check whether all items of a list are equal to a given string.
Your code should pass the test:
assert check_element(["green", "orange", "black", "white"],'blue')==False
|
[
"assert check_element([\"green\", \"orange\", \"black\", \"white\"],'blue')==False",
"assert check_element([1,2,3,4],7)==False",
"assert check_element([\"green\", \"green\", \"green\", \"green\"],'green')==True"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function that matches a string that has an a followed by two to three 'b'.
Your code should pass the test:
assert text_match_two_three("ac")==('Not matched!')
|
[
"assert text_match_two_three(\"ac\")==('Not matched!')",
"assert text_match_two_three(\"dc\")==('Not matched!')",
"assert text_match_two_three(\"abbbba\")==('Found a match!')"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to find the largest sum of contiguous array in the modified array which is formed by repeating the given array k times.
Your code should pass the test:
assert max_sub_array_sum_repeated([10, 20, -30, -1], 4, 3) == 30
|
[
"assert max_sub_array_sum_repeated([10, 20, -30, -1], 4, 3) == 30",
"assert max_sub_array_sum_repeated([-1, 10, 20], 3, 2) == 59",
"assert max_sub_array_sum_repeated([-1, -2, -3], 3, 3) == -1"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a python function to find the sum of squares of first n even natural numbers.
Your code should pass the test:
assert square_Sum(2) == 20
|
[
"assert square_Sum(2) == 20",
"assert square_Sum(3) == 56",
"assert square_Sum(4) == 120"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to count array elements having modular inverse under given prime number p equal to itself.
Your code should pass the test:
assert modular_inverse([ 1, 6, 4, 5 ], 4, 7) == 2
|
[
"assert modular_inverse([ 1, 6, 4, 5 ], 4, 7) == 2",
"assert modular_inverse([1, 3, 8, 12, 12], 5, 13) == 3",
"assert modular_inverse([2, 3, 4, 5], 4, 6) == 1"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a python function to calculate the number of odd days in a given year.
Your code should pass the test:
assert odd_Days(100) == 5
|
[
"assert odd_Days(100) == 5",
"assert odd_Days(50) ==6",
"assert odd_Days(75) == 2"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to find the list of lists with maximum length.
Your code should pass the test:
assert max_length([[0], [1, 3], [5, 7], [9, 11], [13, 15, 17]])==(3, [13, 15, 17])
|
[
"assert max_length([[0], [1, 3], [5, 7], [9, 11], [13, 15, 17]])==(3, [13, 15, 17])",
"assert max_length([[1], [5, 7], [10, 12, 14,15]])==(4, [10, 12, 14,15])",
"assert max_length([[5], [15,20,25]])==(3, [15,20,25])"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to find out the number of ways of painting the fence such that at most 2 adjacent posts have the same color for the given fence with n posts and k colors.
Your code should pass the test:
assert count_no_of_ways(2, 4) == 16
|
[
"assert count_no_of_ways(2, 4) == 16",
"assert count_no_of_ways(3, 2) == 6",
"assert count_no_of_ways(4, 4) == 228"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a python function to find quotient of two numbers.
Your code should pass the test:
assert find(10,3) == 3
|
[
"assert find(10,3) == 3",
"assert find(4,2) == 2",
"assert find(20,5) == 4"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to find the third side of a right angled triangle.
Your code should pass the test:
assert otherside_rightangle(7,8)==10.63014581273465
|
[
"assert otherside_rightangle(7,8)==10.63014581273465",
"assert otherside_rightangle(3,4)==5",
"assert otherside_rightangle(7,15)==16.55294535724685"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to find the maximum value in a given heterogeneous list.
Your code should pass the test:
assert max_val(['Python', 3, 2, 4, 5, 'version'])==5
|
[
"assert max_val(['Python', 3, 2, 4, 5, 'version'])==5",
"assert max_val(['Python', 15, 20, 25])==25",
"assert max_val(['Python', 30, 20, 40, 50, 'version'])==50"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to return the sum of all divisors of a number.
Your code should pass the test:
assert sum_div(8)==7
|
[
"assert sum_div(8)==7",
"assert sum_div(12)==16",
"assert sum_div(7)==1"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a python function to count inversions in an array.
Your code should pass the test:
assert get_Inv_Count([1,20,6,4,5],5) == 5
|
[
"assert get_Inv_Count([1,20,6,4,5],5) == 5",
"assert get_Inv_Count([1,2,1],3) == 1",
"assert get_Inv_Count([1,2,5,6,1],5) == 3"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to flatten a given nested list structure.
Your code should pass the test:
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]
|
[
"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]",
"assert flatten_list([[10, 20], [40], [30, 56, 25], [10, 20], [33], [40]])==[10, 20, 40, 30, 56, 25, 10, 20, 33, 40]",
"assert flatten_list([[1,2,3], [4,5,6], [10,11,12], [7,8,9]])==[1, 2, 3, 4, 5, 6, 10, 11, 12, 7, 8, 9]"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to find the nested list elements which are present in another list.
Your code should pass the test:
assert intersection_nested_lists( [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14],[[12, 18, 23, 25, 45], [7, 11, 19, 24, 28], [1, 5, 8, 18, 15, 16]])==[[12], [7, 11], [1, 5, 8]]
|
[
"assert intersection_nested_lists( [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14],[[12, 18, 23, 25, 45], [7, 11, 19, 24, 28], [1, 5, 8, 18, 15, 16]])==[[12], [7, 11], [1, 5, 8]]",
"assert intersection_nested_lists([[2, 3, 1], [4, 5], [6, 8]], [[4, 5], [6, 8]])==[[], []]",
"assert intersection_nested_lists(['john','amal','joel','george'],[['john'],['jack','john','mary'],['howard','john'],['jude']])==[['john'], ['john'], ['john'], []]"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to calculate the maximum aggregate from the list of tuples.
Your code should pass the test:
assert max_aggregate([('Juan Whelan',90),('Sabah Colley',88),('Peter Nichols',7),('Juan Whelan',122),('Sabah Colley',84)])==('Juan Whelan', 212)
|
[
"assert max_aggregate([('Juan Whelan',90),('Sabah Colley',88),('Peter Nichols',7),('Juan Whelan',122),('Sabah Colley',84)])==('Juan Whelan', 212)",
"assert max_aggregate([('Juan Whelan',50),('Sabah Colley',48),('Peter Nichols',37),('Juan Whelan',22),('Sabah Colley',14)])==('Juan Whelan', 72)",
"assert max_aggregate([('Juan Whelan',10),('Sabah Colley',20),('Peter Nichols',30),('Juan Whelan',40),('Sabah Colley',50)])==('Sabah Colley', 70)"
] | 1
|
function
|
Here is the completed code:
```python
|
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.
Your code should pass the test:
assert count_binary_seq(1) == 2.0
|
[
"assert count_binary_seq(1) == 2.0",
"assert count_binary_seq(2) == 6.0",
"assert count_binary_seq(3) == 20.0"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to find the depth of a dictionary.
Your code should pass the test:
assert dict_depth({'a':1, 'b': {'c': {'d': {}}}})==4
|
[
"assert dict_depth({'a':1, 'b': {'c': {'d': {}}}})==4",
"assert dict_depth({'a':1, 'b': {'c':'python'}})==2",
"assert dict_depth({1: 'Sun', 2: {3: {4:'Mon'}}})==3"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a python function to find the most significant bit number which is also a set bit.
Your code should pass the test:
assert set_Bit_Number(6) == 4
|
[
"assert set_Bit_Number(6) == 4",
"assert set_Bit_Number(10) == 8",
"assert set_Bit_Number(18) == 16"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a python function to check whether the count of inversion of two types are same or not.
Your code should pass the test:
assert solve([1,0,2],3) == True
|
[
"assert solve([1,0,2],3) == True",
"assert solve([1,2,0],3) == False",
"assert solve([1,2,1],3) == True"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a python function to find element at a given index after number of rotations.
Your code should pass the test:
assert find_Element([1,2,3,4,5],[[0,2],[0,3]],2,1) == 3
|
[
"assert find_Element([1,2,3,4,5],[[0,2],[0,3]],2,1) == 3",
"assert find_Element([1,2,3,4],[[0,1],[0,2]],1,2) == 3",
"assert find_Element([1,2,3,4,5,6],[[0,1],[0,2]],1,1) == 1"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to match two words from a list of words starting with letter 'p'.
Your code should pass the test:
assert start_withp(["Python PHP", "Java JavaScript", "c c++"])==('Python', 'PHP')
|
[
"assert start_withp([\"Python PHP\", \"Java JavaScript\", \"c c++\"])==('Python', 'PHP')",
"assert start_withp([\"Python Programming\",\"Java Programming\"])==('Python','Programming')",
"assert start_withp([\"Pqrst Pqr\",\"qrstuv\"])==('Pqrst','Pqr')"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to find the maximum sum of increasing subsequence from prefix till ith index and also including a given kth element which is after i, i.e., k > i .
Your code should pass the test:
assert max_sum_increasing_subseq([1, 101, 2, 3, 100, 4, 5 ], 7, 4, 6) == 11
|
[
"assert max_sum_increasing_subseq([1, 101, 2, 3, 100, 4, 5 ], 7, 4, 6) == 11",
"assert max_sum_increasing_subseq([1, 101, 2, 3, 100, 4, 5 ], 7, 2, 5) == 7",
"assert max_sum_increasing_subseq([11, 15, 19, 21, 26, 28, 31], 7, 2, 4) == 71"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to get a colon of a tuple.
Your code should pass the test:
assert colon_tuplex(("HELLO", 5, [], True) ,2,50)==("HELLO", 5, [50], True)
|
[
"assert colon_tuplex((\"HELLO\", 5, [], True) ,2,50)==(\"HELLO\", 5, [50], True) ",
"assert colon_tuplex((\"HELLO\", 5, [], True) ,2,100)==((\"HELLO\", 5, [100],True))",
"assert colon_tuplex((\"HELLO\", 5, [], True) ,2,500)==(\"HELLO\", 5, [500], True)"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to find the specified number of largest products from two given lists.
Your code should pass the test:
assert large_product([1, 2, 3, 4, 5, 6],[3, 6, 8, 9, 10, 6],3)==[60, 54, 50]
|
[
"assert large_product([1, 2, 3, 4, 5, 6],[3, 6, 8, 9, 10, 6],3)==[60, 54, 50]",
"assert large_product([1, 2, 3, 4, 5, 6],[3, 6, 8, 9, 10, 6],4)==[60, 54, 50, 48]",
"assert large_product([1, 2, 3, 4, 5, 6],[3, 6, 8, 9, 10, 6],5)==[60, 54, 50, 48, 45]"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a python function to find the maximum of two numbers.
Your code should pass the test:
assert maximum(5,10) == 10
|
[
"assert maximum(5,10) == 10",
"assert maximum(-1,-2) == -1",
"assert maximum(9,7) == 9"
] | 1
|
function
|
Here is the completed code:
```python
|
Write a function to convert a given string to a tuple.
Your code should pass the test:
assert string_to_tuple("python 3.0")==('p', 'y', 't', 'h', 'o', 'n', '3', '.', '0')
|
[
"assert string_to_tuple(\"python 3.0\")==('p', 'y', 't', 'h', 'o', 'n', '3', '.', '0')",
"assert string_to_tuple(\"item1\")==('i', 't', 'e', 'm', '1')",
"assert string_to_tuple(\"15.10\")==('1', '5', '.', '1', '0')"
] | 1
|
function
|
Here is the completed code:
```python
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.