messages listlengths 3 3 |
|---|
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to find the smallest multiple of the first n numbers.\n\n",
"role": "user"
},
{
"content": "def smallest_multiple(n):\r\n if... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to combine two dictionaries by adding values for common keys.\n\n",
"role": "user"
},
{
"content": "from collections import Cou... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a python function to count the total unset bits from 1 to n.\n\n",
"role": "user"
},
{
"content": "def count_Unset_Bits(n) : \r\n cnt ... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to return true if the given number is even else return false.\n\n",
"role": "user"
},
{
"content": "def even_num(x):\r\n if x%... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a python function to find the sum of squares of binomial co-efficients.\n\n",
"role": "user"
},
{
"content": "def factorial(start,end): \r... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to extract year, month and date from a url by using regex.\n\n",
"role": "user"
},
{
"content": "import re\r\ndef extract_date(... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to print the first n lucky numbers.\n\n",
"role": "user"
},
{
"content": "def lucky_num(n):\r\n List=range(-1,n*n+9,2)\r\n i=2\... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to find the fixed point in the given array.\n\n",
"role": "user"
},
{
"content": "def find_fixed_point(arr, n): \r\n\tfor i in ... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to find the previous palindrome of a specified number.\n\n",
"role": "user"
},
{
"content": "def previous_palindrome(num):\r\n ... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to validate a gregorian date.\n\n",
"role": "user"
},
{
"content": "import datetime\r\ndef check_date(m, d, y):\r\n try:\r\n... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to compute maximum product of three numbers of a given array of integers using heap queue algorithm.\n\n",
"role": "user"
},
{
... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to find ln, m lobb number.\n\n",
"role": "user"
},
{
"content": "def binomial_coeff(n, k): \r\n\tC = [[0 for j in range(k + 1)]... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to check for a number at the end of a string.\n\n",
"role": "user"
},
{
"content": "import re\r\ndef end_num(string):\r\n te... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a python function to check whether the given string is made up of two alternating characters or not.\n\n",
"role": "user"
},
{
"content": ... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to rearrange positive and negative numbers in a given array using lambda function.\n\n",
"role": "user"
},
{
"content": "def re... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to find if there is a triplet in the array whose sum is equal to a given value.\n\n",
"role": "user"
},
{
"content": "def find_... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to find the sequences of one upper case letter followed by lower case letters.\n\n",
"role": "user"
},
{
"content": "import re\... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to count coin change.\n\n",
"role": "user"
},
{
"content": "def coin_change(S, m, n): \r\n table = [[0 for x in range(m)] fo... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a python function to multiply all items in the list.\n\n",
"role": "user"
},
{
"content": "def multiply_list(items):\r\n tot = 1\r\n ... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to remove all tuples with all none values in the given tuple list.\n\n",
"role": "user"
},
{
"content": "def remove_tuple(test_... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to perform chunking of tuples each of size n.\n\n",
"role": "user"
},
{
"content": "def chunk_tuples(test_tup, N):\r\n res = [... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to find a pair with the highest product from a given array of integers.\n\n",
"role": "user"
},
{
"content": "def max_product(a... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to find the length of the shortest string that has both str1 and str2 as subsequences.\n\n",
"role": "user"
},
{
"content": "de... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to find maximum of two numbers.\n\n",
"role": "user"
},
{
"content": "def max_of_two( x, y ):\r\n if x > y:\r\n retur... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a python function to calculate the product of all the numbers of a given tuple.\n\n",
"role": "user"
},
{
"content": "def mutiple_tuple(nu... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to find n-th rencontres number.\n\n",
"role": "user"
},
{
"content": "def binomial_coeffi(n, k): \r\n\tif (k == 0 or k == n): \... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to calculate the height of the given binary tree.\n\n",
"role": "user"
},
{
"content": "class Node: \r\n\tdef __init__(self, da... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to convert a date of yyyy-mm-dd format to dd-mm-yyyy format.\n\n",
"role": "user"
},
{
"content": "import re\r\ndef change_date... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to count repeated items of a tuple.\n\n",
"role": "user"
},
{
"content": "def count_tuplex(tuplex,value): \r\n count = tuplex... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function that matches a string that has an a followed by zero or more b's by using regex.\n\n",
"role": "user"
},
{
"content": "import r... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to calculate the sum of series 1³+2³+3³+….+n³.\n\n",
"role": "user"
},
{
"content": "import math \r\ndef sum_series(number):\r\... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to remove duplicate words from a given list of strings.\n\n",
"role": "user"
},
{
"content": "def remove_duplic_list(l):\r\n ... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to convert camel case string to snake case string by using regex.\n\n",
"role": "user"
},
{
"content": "import re\r\ndef camel_... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to find the nth delannoy number.\n\n",
"role": "user"
},
{
"content": "def dealnnoy_num(n, m): \r\n\tif (m == 0 or n == 0) : \r... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to calculate the sum of series 1²+2²+3²+….+n².\n\n",
"role": "user"
},
{
"content": "def series_sum(number):\r\n total = 0\r\n ... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to re-arrange the given tuples based on the given ordered list.\n\n",
"role": "user"
},
{
"content": "def re_arrange_tuples(tes... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to count the most common character in a given string.\n\n",
"role": "user"
},
{
"content": "from collections import Counter \r\... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to find three closest elements from three sorted arrays.\n\n",
"role": "user"
},
{
"content": "import sys \r\n\r\ndef find_clos... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to sort a list of dictionaries using lambda function.\n\n",
"role": "user"
},
{
"content": "def sorted_models(models):\r\n sort... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to sort the given array by using heap sort.\n\n",
"role": "user"
},
{
"content": "def heap_sort(arr):\r\n heapify(arr) \r\n... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to count the elements in a list until an element is a tuple.\n\n",
"role": "user"
},
{
"content": "def count_elim(num):\r\n co... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to check if any list element is present in the given list.\n\n",
"role": "user"
},
{
"content": "def check_element(test_tup, ch... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to combine two given sorted lists using heapq module.\n\n",
"role": "user"
},
{
"content": "from heapq import merge\r\ndef comb... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to separate and print the numbers and their position of a given string.\n\n",
"role": "user"
},
{
"content": "import re\r\ndef ... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to convert the given tuples into set.\n\n",
"role": "user"
},
{
"content": "def tuple_to_set(t):\r\n s = set(t)\r\n return (s... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to find the most common elements and their counts of a specified text.\n\n",
"role": "user"
},
{
"content": "from collections i... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a python function to find the length of the shortest word.\n\n",
"role": "user"
},
{
"content": "def len_log(list1):\r\n min=len(list1[... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to get an item of a tuple.\n\n",
"role": "user"
},
{
"content": "def get_item(tup1,index):\r\n item = tup1[index]\r\n return ... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to sort the given tuple list basis the total digits in tuple.\n\n",
"role": "user"
},
{
"content": "def count_digs(tup):\r\n r... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to display sign of the chinese zodiac for given year.\n\n",
"role": "user"
},
{
"content": "def chinese_zodiac(year):\r\n if (y... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to find the maximum of similar indices in two lists of tuples.\n\n",
"role": "user"
},
{
"content": "def max_similar_indices(te... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to compute the value of ncr mod p.\n\n",
"role": "user"
},
{
"content": "def nCr_mod_p(n, r, p): \r\n\tif (r > n- r): \r\n\t\tr... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a python function to find the minimun number of subsets with distinct elements.\n\n",
"role": "user"
},
{
"content": "def subset(ar, n): \... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function that gives profit amount if the given amount has profit else return none.\n\n",
"role": "user"
},
{
"content": "def profit_amou... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to find out, if the given number is abundant.\n\n",
"role": "user"
},
{
"content": "def is_abundant(n):\r\n fctrsum = sum([f... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to split the given string at uppercase letters by using regex.\n\n",
"role": "user"
},
{
"content": "import re\r\ndef split_lis... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a python function to get the position of rightmost set bit.\n\n",
"role": "user"
},
{
"content": "import math\r\ndef get_First_Set_Bit_Pos... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to convert an integer into a roman numeral.\n\n",
"role": "user"
},
{
"content": "def int_to_roman( num):\r\n val = [100... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a python function to find the average of a list.\n\n",
"role": "user"
},
{
"content": "def Average(lst): \r\n return sum(lst) / len(lst... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to solve tiling problem.\n\n",
"role": "user"
},
{
"content": "def get_noOfways(n):\r\n if (n == 0):\r\n return 0;\r\... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to convert a roman numeral to an integer.\n\n",
"role": "user"
},
{
"content": "def roman_to_int(s):\r\n rom_val = {'I':... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a python function to find the sum of all even natural numbers within the range l and r.\n\n",
"role": "user"
},
{
"content": "def sum_Natu... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to calculate the discriminant value.\n\n",
"role": "user"
},
{
"content": "def discriminant_value(x,y,z):\r\n discriminant =... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a python function to check whether the length of the word is even or not.\n\n",
"role": "user"
},
{
"content": "def word_len(s): \r\n s... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to convert camel case string to snake case string.\n\n",
"role": "user"
},
{
"content": "def camel_to_snake(text):\r\n i... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to remove an empty tuple from a list of tuples.\n\n",
"role": "user"
},
{
"content": "def remove_empty(tuple1): #L = [(), (), (... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a python function to accept the strings which contains all vowels.\n\n",
"role": "user"
},
{
"content": "def check(string): \r\n if len(s... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a python function to find maximum possible value for the given periodic function.\n\n",
"role": "user"
},
{
"content": "def floor_Max(A,B,... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to join the tuples if they have similar initial elements.\n\n",
"role": "user"
},
{
"content": "def join_tuples(test_list):\r\n... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to find minimum of two numbers.\n\n",
"role": "user"
},
{
"content": "def min_of_two( x, y ):\r\n if x < y:\r\n retur... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to find the maximum number of segments of lengths a, b and c that can be formed from n.\n\n",
"role": "user"
},
{
"content": "d... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to concatenate the given two tuples to a nested tuple.\n\n",
"role": "user"
},
{
"content": "def concatenate_nested(test_tup1, ... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a python function to left rotate the string.\n\n",
"role": "user"
},
{
"content": "def left_rotate(s,d):\r\n tmp = s[d : ] + s[0 : d]\r... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to find the minimum total path sum in the given triangle.\n\n",
"role": "user"
},
{
"content": "def min_sum_path(A): \r\n\tmemo... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a python function to find minimum sum of factors of a given number.\n\n",
"role": "user"
},
{
"content": "def find_Min_Sum(num): \r\n s... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to count the element frequency in the mixed nested tuple.\n\n",
"role": "user"
},
{
"content": "def flatten(test_tuple): \r\n\t... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to convert tuple into list by adding the given string after every element.\n\n",
"role": "user"
},
{
"content": "def add_str(te... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to find the summation of tuple elements in the given tuple list.\n\n",
"role": "user"
},
{
"content": "def sum_elements(test_tu... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to check if there is a subset with sum divisible by m.\n\n",
"role": "user"
},
{
"content": "def modular_sum(arr, n, m): \r\n\t... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to sort a list of elements using radix sort.\n\n",
"role": "user"
},
{
"content": "def radix_sort(nums):\r\n RADIX = 10\r\n ... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a python function to find the largest postive number from the given list.\n\n",
"role": "user"
},
{
"content": "def largest_pos(list1): \r... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to find the square root of a perfect number.\n\n",
"role": "user"
},
{
"content": "import math\r\ndef sqrt_root(num):\r\n sqrt_... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to calculate volume of a tetrahedron.\n\n",
"role": "user"
},
{
"content": "import math\r\ndef volume_tetrahedron(num):\r\n\tvo... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to find the lcm of the given array elements.\n\n",
"role": "user"
},
{
"content": "def find_lcm(num1, num2): \r\n\tif(num1>num2... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to print check if the triangle is scalene or not.\n\n",
"role": "user"
},
{
"content": "def check_isosceles(x,y,z):\r\n if x!=... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to find the longest bitonic subsequence for the given array.\n\n",
"role": "user"
},
{
"content": "def lbs(arr): \r\n\tn = len(... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.\n\n",
"... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to find the sum of maximum increasing subsequence of the given array.\n\n",
"role": "user"
},
{
"content": "def max_sum_increas... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a python function to check whether two given lines are parallel or not.\n\n",
"role": "user"
},
{
"content": "def parallel_lines(line1, li... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a python function to capitalize first and last letters of each word of a given string.\n\n",
"role": "user"
},
{
"content": "def capitaliz... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to find all pairs in an integer array whose sum is equal to a given number.\n\n",
"role": "user"
},
{
"content": "def get_pairs... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to find the list of lists with minimum length.\n\n",
"role": "user"
},
{
"content": "def min_length(list1):\r\n min_length = ... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to find the nth jacobsthal-lucas number.\n\n",
"role": "user"
},
{
"content": "def jacobsthal_lucas(n): \r\n\tdp=[0] * (n + 1) ... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to find the ration of negative numbers in an array of integers.\n\n",
"role": "user"
},
{
"content": "from array import array\r... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to find minimum number of coins that make a given value.\n\n",
"role": "user"
},
{
"content": "import sys \r\ndef min_coins(coi... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to check if the two given strings are permutations of each other.\n\n",
"role": "user"
},
{
"content": "def check_permutation(s... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to remove particular data type elements from the given tuple.\n\n",
"role": "user"
},
{
"content": "def remove_datatype(test_tu... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to search a literals string in a string and also find the location within the original string where the pattern occurs.\n\n",
"role": "... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to find the top or bottom surface area of a cylinder.\n\n",
"role": "user"
},
{
"content": "def topbottom_surfacearea(r):\r\n ... |
[
{
"content": "\nWrite a functional code based on the question given in the QUESTION field.\n",
"role": "system"
},
{
"content": "\nQUESTION:\n\nWrite a function to select the nth items of a list.\n\n",
"role": "user"
},
{
"content": "def nth_items(list,n):\r\n return list[::n]",
"rol... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.