Input: A = B = Output: def merge_sort(A, B): result = i, j = 0, 0 # Compare elements and add lower one to result while i < len(A) and j < len(B): if ...
Input: A = B = Output: def merge_sort(A, B): result = i, j = 0, 0 # Compare elements and add lower one to result while i < len(A) and j < len(B): if ...
Input: Output: import random number = random.randint(100000, 999999) print(number) Prompt: Below is an instruction that describes a task. Write a ...
Input: A = B = Output: def merge_sort(A, B): result = i, j = 0, 0 # Compare elements and add lower one to result while i < len(A) and j < len(B): if ...
Input: Output: import numpy as np import tensorflow as tf def create_model(): model = tf.keras.Sequential([ tf.keras.layers.Dense(64, ...
Input: Output: def fibonacci(n): a = 0 b = 1 if n < 0: print("Incorrect input") elif n == 0: return a elif n == 1: ...
Input: username: @elonmusk Output: import tweepy # Authenticate to Twitter auth = tweepy.OAuthHandler("CONSUMER_KEY", "CONSUMER_SECRET") ...
Input: even_numbers = for i in range(1,21): if i % 2 == 0: even_numbers.append(i) Output: even_numbers = Prompt: Below is an instruction ...
Input: board = [ , , , , , , , , ] Output: def solve_sudoku(board): # Utility function to find vacant cells ...
Input: Output: def sum_digits(num): total = 0 while num > 0: digit = num % 10 total += digit num = num // 10 return ...
Input: parameter_1 = 7 parameter_2 = 9 Output: def printMax(parameter_1, parameter_2): if parameter_1 > parameter_2: print(parameter_1) ...
Input: John (20), Jane (40), Alex (18), Peter (45) Output: people_dict = {'John': 20, 'Jane': 40, 'Alex': 18, 'Peter': 45} Prompt: Below is an ...
No widgets added. You can disable footer widget area in theme options - footer options