[output] | x <> y [instruction] | Change the comparison operator in the given line to its equivalent. [input] | x != y
[output] | import requests response = requests.get("https://example.com") print(response.content) [instruction] | Make a HTTP request to get the content of the given URL. [input] | https://example.com
[output] | 19-03-2020 17:30 [instruction] | Format the given date and time as DD-MM-YYYY HH:MM [input] | 19-03-2020 17:30
[output] | occurrences = { 'H': 1, 'e': 1, 'l': 3, 'o': 2, ' ': 1, 'W': 1, 'r': 1, 'd': 1 } [instruction] | Use the given string to find the number of occurrences of each letter. [input] | Hello World
[output] | for i in range(5): print(arr[i]) [instruction] | Update the code to print out the first five elements of the given list. [input] | [3, 4, 1, 6, 8, 9]
[output] | arr = [1, 4, 5, 6, 7, 8] [instruction] | Sort the given list with size constraint N in increasing order. [input] | N = 4 arr = [8, 7, 6, 5, 4, 1]
[output] | SELECT name, salary FROM employees WHERE salary BETWEEN 10000 AND 50000; [instruction] | Write a query to select the employee name and salary whose salary is between 10000 and 50000. [input] |
[output] | 0x50797468 [instruction] | Use the given string and convert it to hexadecimal representation. [input] | Python
[output] | INSERT INTO customers (name, age, occupation) VALUES ('Henry Smith', 25, 'Real Estate Agent'); [instruction] | Administer a MySQL database to save the customer information below. [input] | Henry Smith;25;Real Estate Agent
[output] | var arr = [2, 0, 1]; arr = arr.filter(element => element >= 0); [instruction] | Modify the code below to filter out negative numbers from the given array. [input] | var arr = [2, -4, -6, 0, 1];
[output] | There is no definite answer to this question. It depends on the creativity and programming skills of the individual. It is possible to write an infinite number of jokes, but writing a joke that is funny and unique will require more effort and expertise. [instruction] | How many jokes can you write in Python? [input] |
[output] | def longest_string(str1, str2, str3): if len(str1) >= len(str2) and len(str1) >= len(str3): print(str1) elif len(str2) >= len(str1) and len(str2) >= len(str3): print(str2) else: print(str3) [instruction] | Implement a function that takes in three string parameters and prints out the longest one. [input] |
[output] | class BankAccount(): def __init__(self, accountNumber, balance): self.accountNumber = accountNumber self.balance = balance [instruction] | Create a class called "BankAccount" with two instance variables "accountNumber" and "balance". [input] |
[output] | INSERT INTO User (Country) VALUES ('Indonesia'); [instruction] | Insert data into a specific field in a given table. [input] | Table Name: User Field: Country Data: Indonesia
[output] | def sum(x, y): return x + y [instruction] | Complete the function definition so that it takes in two parameters "x" and "y" and returns the sum of x and y. [input] | def sum(x, y):
[output] | let a = 0, b =1, result for (let i = 0; i < n; i++) { result = a + b a = b b = result console.log(a) } [instruction] | Edit the given JavaScript code so that the output is the Fibonacci sequence from 1 to "n". [input] | let a = 0, b = 1, result for (let i = 1; i < n; i++) { result = a + b a = b b = result } console.log(result)
[output] | x = 4 [instruction] | Calculate the value of "x" in the equation "5x - 12 = 8". [input] |
[output] | SELECT * FROM Country WHERE Name = 'USA'; [instruction] | Create SQL to select data from the table that has a specific value in the 'name' field. [input] | Table Name: Country Field: Name Value: USA
[output] | class Employee(): def __init__(self, name, salary, position): self.name =name self.salary = salary self.position = position [instruction] | Create a class called "Employee" with three instance variables: 'Name', 'Salary', and 'Position'. [input] |
[output] | def Employee(name, age): return (name, age) def print_details(employee): name, age = employee print(f"Name: {name}, age: {age}") [instruction] | Convert the code from OOP to a functional programming style. [input] | class Employee: def __init__(self, name, age): self.name = name self.age = age def print_details(self): print(f"Name: {self.name}, age: {self.age}")
[output] | def compare_strings(str1, str2): if len(str1) != len(str2): return False for i in range(len(str1)): if str1[i] != str2[i]: return False return True [instruction] | Generate code that implements a method to compare two strings. [input] |
[output] | A shallow copy of an object creates a new object with the same values as the original but with a different location in memory. A deep copy of an object copies not just the values of the original object but also creates copies of any objects that the original object is referencing. The result is two [instruction] | Explain the difference between a shallow copy and a deep copy. [input] |
[output] | def reverse_string(str) str.reverse end puts reverse_string("Hello world!") #=> "!dlrow olleH" [instruction] | Create a Ruby program that reverses the characters of a provided string. [input] | Input: "Hello world!"
[output] | SELECT NAME FROM TABLE WHERE NAME LIKE "A%" LIMIT 10; [instruction] | Create a SQL query that generates the first 10 names starting with "A". [input] |
[output] | This string is a palindrome. [instruction] | Categorize the following string as either a palindrome or not. [input] | Input: "racecar"
[output] | #!/bin/bash exit 0 [instruction] | Write a shell script that exits with a status code of 0. [input] |
[output] | a[href*="Learn"] { color: blue; } [instruction] | Modify the following CSS code to target the links with the word "Learn". [input] | a { color: blue; }
[output] | The fifth prime number is 11. [instruction] | What is the fifth prime number? [input] |
[output] | <div class="columns"> <div class="column"> <h1>Hello world!</h1> </div> <div class="column"> <p>Welcome to my website.</p> </div> </div> [instruction] | Subdivide the following HTML into two columns. [input] | <div> <h1>Hello world!</h1> <p>Welcome to my website.</p> </div>
[output] | F8a_3q4*f2 [instruction] | Create a randomized password of 10 characters. [input] |