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 python function to count the number of equal numbers from three given integers.\n\n", "role": "user" }, { "content": "def test_three_equ...
[ { "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 number of rotations required to generate a sorted array.\n\n", "role": "user" }, { "content": "def count_Ro...
[ { "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 number is a perfect square or not.\n\n", "role": "user" }, { "content": "def is_Perfect_Squar...
[ { "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 product of numbers is even or not.\n\n", "role": "user" }, { "content": "def is_Product_Even(arr,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 list in a list of lists whose sum of elements is the highest.\n\n", "role": "user" }, { "content": "def max_sum_lis...
[ { "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 run of uppercase characters in the given string.\n\n", "role": "user" }, { "content": "def max_run_uppercase(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 find the first odd number in a given list of numbers.\n\n", "role": "user" }, { "content": "def first_odd(nums):\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 check if the given tuples contain the k or not.\n\n", "role": "user" }, { "content": "def check_K(test_tup, K):\r\n res = 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 check if each element of second tuple is smaller than its corresponding index in first tuple.\n\n", "role": "user" }, { "con...
[ { "content": "\nWrite a functional code based on the question given in the QUESTION field.\n", "role": "system" }, { "content": "\nQUESTION:\n\nWrite a function to iterate over elements repeating each as many times as its count.\n\n", "role": "user" }, { "content": "from collections impo...
[ { "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 two lists of tuples are identical or not.\n\n", "role": "user" }, { "content": "def check_identical(test_list1, 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 abbreviate 'road' as 'rd.' in a given string.\n\n", "role": "user" }, { "content": "import re\r\ndef road_rd(street):\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 find length of the string.\n\n", "role": "user" }, { "content": "def string_length(str1):\r\n count = 0\r\n for char 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 find the area of a rombus.\n\n", "role": "user" }, { "content": "def rombus_area(p,q):\r\n area=(p*q)/2\r\n return area", ...
[ { "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 without using any sorting algorithm. the given array consists of only 0, 1, and 2.\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 clear the values of the given tuples.\n\n", "role": "user" }, { "content": "def clear_tuple(test_tup):\r\n temp = list(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 find numbers divisible by m or n from a list of numbers using lambda function.\n\n", "role": "user" }, { "content": "def div...
[ { "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 lower case letters in a given string.\n\n", "role": "user" }, { "content": "def lower_ctr(str):\r\n lower_...
[ { "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 frequency of consecutive duplicate elements in a given list of numbers.\n\n", "role": "user" }, { "content": "def ...
[ { "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 the given month number contains 28 days or not.\n\n", "role": "user" }, { "content": "def check_monthnum_numbe...
[ { "content": "\nWrite a functional code based on the question given in the QUESTION field.\n", "role": "system" }, { "content": "\nQUESTION:\n\nWrite a function to merge two dictionaries into a single expression.\n\n", "role": "user" }, { "content": "import collections as ct\r\ndef merge...
[ { "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 password is valid.\n\n", "role": "user" }, { "content": "import re\r\ndef pass_validity(p):\r\n x = True\...
[ { "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 given string starts with a substring using regex.\n\n", "role": "user" }, { "content": "import re \r\ndef check...
[ { "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 remove even numbers from a given list.\n\n", "role": "user" }, { "content": "def remove_even(l):\r\n for i in l:\r...
[ { "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 access multiple elements of specified index from a given list.\n\n", "role": "user" }, { "content": "def access_eleme...
[ { "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 type of triangle from the given sides.\n\n", "role": "user" }, { "content": "def check_Type_Of_Triangle(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 sum a specific column of a list in a given list of lists.\n\n", "role": "user" }, { "content": "def sum_column(list1, C):\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 count alphabets,digits and special charactes in a given string.\n\n", "role": "user" }, { "content": "def count_alpha_dig_sp...
[ { "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 the second most repeated (or frequent) string in the given sequence.\n\n", "role": "user" }, { "content": "from col...
[ { "content": "\nWrite a functional code based on the question given in the QUESTION field.\n", "role": "system" }, { "content": "\nQUESTION:\n\nWrite a function to round up a number to specific digits.\n\n", "role": "user" }, { "content": "import math\r\ndef round_up(a, digits):\r\n 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 count equal element pairs from the given array.\n\n", "role": "user" }, { "content": "def count_Pairs(arr,n): \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 extract the maximum numeric value from a string by using regex.\n\n", "role": "user" }, { "content": "import re \r\ndef extr...
[ { "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 dictionary keys as a list.\n\n", "role": "user" }, { "content": "def get_key(dict): \r\n list = [] \r\n for key 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 generate a square matrix filled with elements from 1 to n raised to the power of 2 in spiral order.\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 python function to find the slope of a line.\n\n", "role": "user" }, { "content": "def slope(x1,y1,x2,y2): \r\n return (float)(y2-y1)...
[ { "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 length of the subarray having maximum sum.\n\n", "role": "user" }, { "content": "from sys import maxsize \r\ndef max_su...
[ { "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 cube sum of first n odd natural numbers.\n\n", "role": "user" }, { "content": "def cube_Sum(n): \r\n sum ...
[ { "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 number swaps required to make two binary strings equal.\n\n", "role": "user" }, { "content": "def min_Sw...
[ { "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 tuples alphabetically by the first item of each tuple.\n\n", "role": "user" }, { "content": "def sort_tuple(tup): \...
[ { "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 roots of a quadratic equation are numerically equal but opposite in sign or not.\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 count the number of inversions in the given array.\n\n", "role": "user" }, { "content": "def get_inv_count(arr, n): \r\n\tin...
[ { "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 number which occurs for odd number of times in the given array.\n\n", "role": "user" }, { "content": "def get_odd_o...
[ { "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 super ugly number from a given prime list of size k using heap queue algorithm.\n\n", "role": "user" }, { "cont...
[ { "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 kth element in an array containing odd elements first and then even elements.\n\n", "role": "user" }, { "con...
[ { "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 number of digits in factorial of a given number.\n\n", "role": "user" }, { "content": "import math \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 find the minimum number of platforms required for a railway/bus station.\n\n", "role": "user" }, { "content": "def find_plat...
[ { "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 copy a list from a singleton tuple.\n\n", "role": "user" }, { "content": "def lcopy(xs):\n return xs[:]\n", "rol...
[ { "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 area of a trapezium.\n\n", "role": "user" }, { "content": "def area_trapezium(base1,base2,height):\r\n area = 0.5 *...
[ { "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 sum of all prime divisors of a given number.\n\n", "role": "user" }, { "content": "def Sum(N): \r\n SumOfPrim...
[ { "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 a triangle of positive area is possible with the given angles.\n\n", "role": "user" }, { "content": "def is_triangl...
[ { "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 sum of inverse of divisors.\n\n", "role": "user" }, { "content": "def Sum_of_Inverse_Divisors(N,Sum): \r\n an...
[ { "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 remove negative numbers from a list.\n\n", "role": "user" }, { "content": "def remove_negs(num_list): \r\n for ite...
[ { "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 sum of odd factors of a number.\n\n", "role": "user" }, { "content": "import math\r\ndef sum_of_odd_Factors(n): ...
[ { "content": "\nWrite a functional code based on the question given in the QUESTION field.\n", "role": "system" }, { "content": "\nQUESTION:\n\nWrite a function which accepts an arbitrary list and converts it to a heap using heap queue algorithm.\n\n", "role": "user" }, { "content": "imp...
[ { "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 for even parity of a given number.\n\n", "role": "user" }, { "content": "def check_Even_Parity(x): \r\n pari...
[ { "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 adjacent swaps required to sort binary array.\n\n", "role": "user" }, { "content": "def find_Min_Swaps(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 list out the list of given strings individually using map function.\n\n", "role": "user" }, { "content": "def listify_list(l...
[ { "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 number of lists in a given list of lists and square the count.\n\n", "role": "user" }, { "content": "def count_list(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 generate all sublists of a given list.\n\n", "role": "user" }, { "content": "from itertools import combinations\r\ndef sub_l...
[ { "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 the given string is ending with only alphanumeric characters or not using regex.\n\n", "role": "user" }, { "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 find all anagrams of a string in a given list of strings using lambda function.\n\n", "role": "user" }, { "content": "from c...
[ { "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 occurrences of n most common words in a given text.\n\n", "role": "user" }, { "content": "from collections import C...
[ { "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 longest sub-sequence such that elements in the subsequences are consecutive integers.\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 palindromes in a given list of strings using lambda function.\n\n", "role": "user" }, { "content": "def palindrome_lamb...
[ { "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 n-times a list using map function.\n\n", "role": "user" }, { "content": "def ntimes_list(nums,n):\r\n result = map(...
[ { "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 the given month name contains 31 days or not.\n\n", "role": "user" }, { "content": "def check_monthnumb(monthn...
[ { "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 add a minimum number such that the sum of array becomes even.\n\n", "role": "user" }, { "content": "def min_Num(arr,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 length of the last word in a given string.\n\n", "role": "user" }, { "content": "def length_Of_Last_Word(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 remove sublists from a given list of lists, which are outside a given range.\n\n", "role": "user" }, { "content": "def remov...
[ { "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 the positive numbers of a given list of numbers using lambda function.\n\n", "role": "user" }, { "conte...
[ { "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 strings are rotations of each other or not.\n\n", "role": "user" }, { "content": "def are_Rot...
[ { "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 a nested list is a subset of another nested list.\n\n", "role": "user" }, { "content": "def check_subset(list1,list...
[ { "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 the fibonacci sequence using recursion.\n\n", "role": "user" }, { "content": "def fibonacci(n):\r\n if n == 1 or 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 check if the string is a concatenation of another string.\n\n", "role": "user" }, { "content": "def check_Concat(str1...
[ { "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 difference in the tuple pairs of given tuples.\n\n", "role": "user" }, { "content": "def min_difference(tes...
[ { "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 lcm of two positive integers.\n\n", "role": "user" }, { "content": "def lcm(x, y):\r\n if x > y:\r\n z =...
[ { "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 sort the given string.\n\n", "role": "user" }, { "content": "def sort_String(str) : \r\n str = ''.join(sorted(str)...
[ { "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 given tuple contains only k elements.\n\n", "role": "user" }, { "content": "def check_tuples(test_tuple, K):\r\...
[ { "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 anything, ending in 'b' by using regex.\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 python function to find number of solutions in quadratic equation.\n\n", "role": "user" }, { "content": "def Check_Solution(a,b,c) : \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 sum of first even and odd number of a given list.\n\n", "role": "user" }, { "content": "def sum_even_odd(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 caluclate perimeter of a parallelogram.\n\n", "role": "user" }, { "content": "def parallelogram_perimeter(b,h):\r\n perimet...
[ { "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 numbers divisible by m and n from a list of numbers using lambda function.\n\n", "role": "user" }, { "content": "def di...
[ { "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 all the bits are within a given range or not.\n\n", "role": "user" }, { "content": "def all_Bits_Set_In...
[ { "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 two given strings are isomorphic to each other or not.\n\n", "role": "user" }, { "content": "def is...
[ { "content": "\nWrite a functional code based on the question given in the QUESTION field.\n", "role": "system" }, { "content": "\nQUESTION:\n\nWrite a function to add all the numbers in a list and divide it with the length of the list.\n\n", "role": "user" }, { "content": "def sum_num(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 check whether the given number is odd or not using bitwise operator.\n\n", "role": "user" }, { "content": "def is_odd...
[ { "content": "\nWrite a functional code based on the question given in the QUESTION field.\n", "role": "system" }, { "content": "\nQUESTION:\n\nWrite a function to substract the elements of the given nested tuples.\n\n", "role": "user" }, { "content": "def substract_elements(test_tup1, 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 reverse each list in a given list of lists.\n\n", "role": "user" }, { "content": "def reverse_list_lists(lists):\r\n for ...
[ { "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 index of an extra element present in one sorted array.\n\n", "role": "user" }, { "content": "def find_Extra(...
[ { "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 two numbers have same number of digits or not.\n\n", "role": "user" }, { "content": "def same...
[ { "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 multiple spaces in a string.\n\n", "role": "user" }, { "content": "import re\r\ndef remove_spaces(text):\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 python function to get the last element of each sublist.\n\n", "role": "user" }, { "content": "def Extract(lst): \r\n return [item[-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 convert the given string of float type into tuple.\n\n", "role": "user" }, { "content": "def float_to_tuple(test_str):\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 the maximum sum of subsequences of given array with no adjacent elements.\n\n", "role": "user" }, { "content": "def max...
[ { "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 in increasing order by the last element in each tuple from a given list of non-empty tuples.\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 python function to check whether the word is present in a given sentence or not.\n\n", "role": "user" }, { "content": "def is_Word_Prese...
[ { "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 specified number of elements from a given list, which follow each other continuously.\n\n", "role": "user" }, { "con...
[ { "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 an array can be sorted or not by picking only the corner elements.\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 where a string will start with a specific number.\n\n", "role": "user" }, { "content": "import re\r\ndef match_num(string):\r\n...