messages
listlengths
2
2
instruction
stringlengths
14
288
input
stringlengths
0
635
output
stringlengths
1
3.91k
[ { "role": "user", "content": "Find the mean of the list of numbers [1,2,3,4,5,6,7]" }, { "role": "assistant", "content": "list = [1,2,3,4,5,6,7]\n\nsum = 0\nfor i in list:\n sum += i\n\nmean = sum/len(list)\n\nprint(mean)" } ]
Find the mean of the list of numbers [1,2,3,4,5,6,7]
list = [1,2,3,4,5,6,7] sum = 0 for i in list: sum += i mean = sum/len(list) print(mean)
[ { "role": "user", "content": "Complete the following line of code to successfully initiate a pandas dataframe without specifying column names or data." }, { "role": "assistant", "content": "df = pd.DataFrame(data=None, columns=None)" } ]
Complete the following line of code to successfully initiate a pandas dataframe without specifying column names or data.
df = pd.DataFrame(data=None, columns=None)
[ { "role": "user", "content": "Write a function to convert the given list of integers into a dictionary of lists.\n\nmy_list = [1, 2, 3, 4]" }, { "role": "assistant", "content": "def list_to_dict(lst):\n my_dict = {}\n for i in lst:\n my_dict[str(i)] = [i]\n return my_dict\n\nif _...
Write a function to convert the given list of integers into a dictionary of lists.
my_list = [1, 2, 3, 4]
def list_to_dict(lst): my_dict = {} for i in lst: my_dict[str(i)] = [i] return my_dict if __name__ == '__main__': my_list = [1, 2, 3, 4] print(list_to_dict(my_list))
[ { "role": "user", "content": "Create a HTML page with a table which contains data about the student population." }, { "role": "assistant", "content": "<html>\n<body>\n\n<table>\n<tr>\n <th>Student Name</th>\n <th>Class</th>\n <th>Age</th>\n</tr>\n<tr>\n <td>John</td>\n <td>8th</td>\n <td>1...
Create a HTML page with a table which contains data about the student population.
<html> <body> <table> <tr> <th>Student Name</th> <th>Class</th> <th>Age</th> </tr> <tr> <td>John</td> <td>8th</td> <td>14</td> </tr> <tr> <td>Ann</td> <td>9th</td> <td>15</td> </tr> <tr> <td>James</td> <td>10th</td> <td>16</td> </tr> </table> </body> </html>
[ { "role": "user", "content": "Create a JavaScript function that can convert miles to kilometers." }, { "role": "assistant", "content": "function convertMilesToKilometers(miles) {\n return miles * 1.60934;\n}" } ]
Create a JavaScript function that can convert miles to kilometers.
function convertMilesToKilometers(miles) { return miles * 1.60934; }
[ { "role": "user", "content": "Implement an algorithm to delete a node in a singly linked list, given only access to the node.\n\nhead = [4, 5, 1, 9]\ndel = 5" }, { "role": "assistant", "content": "def deleteNode(head, del): \n \n # If the node to be deleted is the head node \n if head.dat...
Implement an algorithm to delete a node in a singly linked list, given only access to the node.
head = [4, 5, 1, 9] del = 5
def deleteNode(head, del): # If the node to be deleted is the head node if head.data == del: head = head.next return head # Find previous node of the node to be deleted previous = head while previous.next and previous.next.data != del: previous = previous.next ...
[ { "role": "user", "content": "Create a function to get the root of a quadratic equation\n\n1, 4, 4" }, { "role": "assistant", "content": "def get_roots_of_quad_eqn(a, b, c):\n # compute discriminant \n d = (b**2) - (4 * a * c)\n \n # compute roots\n root1 = (-b + math.sqrt(d)) / (...
Create a function to get the root of a quadratic equation
1, 4, 4
def get_roots_of_quad_eqn(a, b, c): # compute discriminant d = (b**2) - (4 * a * c) # compute roots root1 = (-b + math.sqrt(d)) / (2 * a) root2 = (-b - math.sqrt(d)) / (2 * a) # return the roots return root1, root2 if __name__ == '__main__': a, b, c = 1, 4, 4 print(get_...
[ { "role": "user", "content": "Create a function that takes in an integer and returns true if the number is prime or false if the number is not prime." }, { "role": "assistant", "content": "def is_prime(num):\n for n in range(2, num):\n if(num % n == 0):\n return False\n e...
Create a function that takes in an integer and returns true if the number is prime or false if the number is not prime.
def is_prime(num): for n in range(2, num): if(num % n == 0): return False else: return True
[ { "role": "user", "content": "Convert the following HTML table into a valid JSON format.\n\n<table>\n <tr>\n <th>Name</th>\n <th>Age</th>\n <th>Country</th>\n </tr>\n <tr>\n <td>John</td>\n <td>23</td>\n <td>USA</td>\n </tr>\n <tr>\n <td>Jack</td>\n <td>25</td>\n <td>Canada</td>\n </tr>\n <tr>\n <...
Convert the following HTML table into a valid JSON format.
<table> <tr> <th>Name</th> <th>Age</th> <th>Country</th> </tr> <tr> <td>John</td> <td>23</td> <td>USA</td> </tr> <tr> <td>Jack</td> <td>25</td> <td>Canada</td> </tr> <tr> <td>Jane</td> <td>20</td> <td>Australia</td> </tr> </table>
[ { "Name": "John", "Age": 23, "Country": "USA" }, { "Name": "Jack", "Age": 25, "Country": "Canada" }, { "Name": "Jane", "Age": 20, "Country": "Australia" } ]
[ { "role": "user", "content": "Create a class called 'Student' with attributes name and grade." }, { "role": "assistant", "content": "class Student:\n def __init__(self, name, grade):\n self.name = name\n self.grade = grade" } ]
Create a class called 'Student' with attributes name and grade.
class Student: def __init__(self, name, grade): self.name = name self.grade = grade
[ { "role": "user", "content": "Create a SQL query to select the most recent 5 posts from a table ordered by the post date." }, { "role": "assistant", "content": "SELECT * FROM Posts\nORDER BY PostDate DESC\nLIMIT 5;" } ]
Create a SQL query to select the most recent 5 posts from a table ordered by the post date.
SELECT * FROM Posts ORDER BY PostDate DESC LIMIT 5;
[ { "role": "user", "content": "Given a matrix of size NxM, make a code that prints the transpose of the matrix.\n\n[[12,7],[4,5],[3,8]]" }, { "role": "assistant", "content": "[[12,4,3],[7,5,8]]" } ]
Given a matrix of size NxM, make a code that prints the transpose of the matrix.
[[12,7],[4,5],[3,8]]
[[12,4,3],[7,5,8]]
[ { "role": "user", "content": "Create a GraphQL query that returns all the top five countries in terms of population." }, { "role": "assistant", "content": "query {\n countries(first: 5) {\n name\n population\n }\n}" } ]
Create a GraphQL query that returns all the top five countries in terms of population.
query { countries(first: 5) { name population } }
[ { "role": "user", "content": "Create a list comprehension to convert each element to its square root.\n\nmy_list = [1, 4, 9, 16, 25]" }, { "role": "assistant", "content": "squared_list = [x**0.5 for x in my_list]" } ]
Create a list comprehension to convert each element to its square root.
my_list = [1, 4, 9, 16, 25]
squared_list = [x**0.5 for x in my_list]
[ { "role": "user", "content": "Classify the following sentence according to the type of speech it is.\n\nJohn said: \"Let's go to the zoo.\"" }, { "role": "assistant", "content": "Direct speech." } ]
Classify the following sentence according to the type of speech it is.
John said: "Let's go to the zoo."
Direct speech.
[ { "role": "user", "content": "Write a Java method that takes a string and returns a copy of the string with all lowercase letters replaced with uppercase letters.\n\nmixed case" }, { "role": "assistant", "content": "public static String toUpperCase(String s) {\n return s.toUpperCase();\n}" ...
Write a Java method that takes a string and returns a copy of the string with all lowercase letters replaced with uppercase letters.
mixed case
public static String toUpperCase(String s) { return s.toUpperCase(); }
[ { "role": "user", "content": "Create a code to read a textfile line by line and print out the lines that have the word \"Python\"." }, { "role": "assistant", "content": "with open('textfile.txt') as f:\n for line in f:\n if 'Python' in line:\n print(line)" } ]
Create a code to read a textfile line by line and print out the lines that have the word "Python".
with open('textfile.txt') as f: for line in f: if 'Python' in line: print(line)
[ { "role": "user", "content": "Evaluate the expression 200 + 400 / 2." }, { "role": "assistant", "content": "# Evaluate the expression 200 + 400 / 2\n\nresult = 200 + 400 / 2\n\nprint(result) # Output: 300.0" } ]
Evaluate the expression 200 + 400 / 2.
# Evaluate the expression 200 + 400 / 2 result = 200 + 400 / 2 print(result) # Output: 300.0
[ { "role": "user", "content": "Create a class definition in python with one variable and one method" }, { "role": "assistant", "content": "class Example:\n def __init__(self, variable):\n self.variable = variable\n\n def method(self):\n return self.variable + 1" } ]
Create a class definition in python with one variable and one method
class Example: def __init__(self, variable): self.variable = variable def method(self): return self.variable + 1
[ { "role": "user", "content": "Write the definition of function to calculate the perimeter of a triangle." }, { "role": "assistant", "content": "def perimeter(a, b, c):\n return a + b + c" } ]
Write the definition of function to calculate the perimeter of a triangle.
def perimeter(a, b, c): return a + b + c
[ { "role": "user", "content": "Parse the following JSON object and extract the data stored in the \"details\" field.\n\n{\n \"data\": [\n {\n \"name\": \"John\",\n \"details\": {\n \"address\": \"123 Main St.\",\n \"phone\": \"000-123-4567\"\n ...
Parse the following JSON object and extract the data stored in the "details" field.
{ "data": [ { "name": "John", "details": { "address": "123 Main St.", "phone": "000-123-4567" } } ] }
const parsedJSON = JSON.parse(jsonObject); const address = parsedJSON.data[0].details.address; const phone = parsedJSON.data[0].details.phone;
[ { "role": "user", "content": "Explain what is the value of the variable x after this following code is executed:\n\nx = 5\ny = x + 9" }, { "role": "assistant", "content": "The value of x after the code is executed is 5. After y is assigned the value of x + 9, the value of x is unchanged." } ]
Explain what is the value of the variable x after this following code is executed:
x = 5 y = x + 9
The value of x after the code is executed is 5. After y is assigned the value of x + 9, the value of x is unchanged.
[ { "role": "user", "content": "Using PHP, write a program to check if a string contains only alphabets." }, { "role": "assistant", "content": "<?php\nfunction checkAlphabetical($str) {\n $len = strlen($str); \n \n // Traverse the given string, check\n // for every character \n for ($i =...
Using PHP, write a program to check if a string contains only alphabets.
<?php function checkAlphabetical($str) { $len = strlen($str); // Traverse the given string, check // for every character for ($i = 0; $i < $len; $i++) { // If the string contains any // non-alphabetical character if((ord($str[$i]) > 64 && ord($str[$i]) < 91) ...
[ { "role": "user", "content": "Generate a code to find the power of n to m.\n\nn = 3, m = 7" }, { "role": "assistant", "content": "def pow_n_m(n, m):\n result = 1\n for i in range(1, m+1):\n result *= n\n return result\n \n# example \nn = 3 \nm = 7\nprint(pow_n_m(n, m))" } ]
Generate a code to find the power of n to m.
n = 3, m = 7
def pow_n_m(n, m): result = 1 for i in range(1, m+1): result *= n return result # example n = 3 m = 7 print(pow_n_m(n, m))
[ { "role": "user", "content": "Suggest a way to combine two lists of dictionaries into one list of dictionaries in Python.\n\nlist1 = [{'name': 'John', 'age': 23}, {'name': 'Mary', 'age': 20}]\nlist2 = [{'name': 'Steve', 'age': 25}, {'name': 'Jake', 'age': 18}]" }, { "role": "assistant", "content...
Suggest a way to combine two lists of dictionaries into one list of dictionaries in Python.
list1 = [{'name': 'John', 'age': 23}, {'name': 'Mary', 'age': 20}] list2 = [{'name': 'Steve', 'age': 25}, {'name': 'Jake', 'age': 18}]
combinedList = list1 + list2
[ { "role": "user", "content": "Read the data structure and output the sum of all the values.\n\ndata = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]" }, { "role": "assistant", "content": "let total = 0;\ndata.forEach((arr)=> {\n\tarr.forEach(num => {\n\t\ttotal += num;\n\t});\n});\nconsole.log(total); //45" ...
Read the data structure and output the sum of all the values.
data = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
let total = 0; data.forEach((arr)=> { arr.forEach(num => { total += num; }); }); console.log(total); //45
[ { "role": "user", "content": "classify the following text into its respective category\n\nOnce upon a time, there was a young prince who lived in a castle" }, { "role": "assistant", "content": "Storytelling" } ]
classify the following text into its respective category
Once upon a time, there was a young prince who lived in a castle
Storytelling
[ { "role": "user", "content": "Write an HTML page to display a form for user registration." }, { "role": "assistant", "content": "<!DOCTYPE html>\n<html>\n <head>\n <title>User Registration Form</title>\n </head>\n <body>\n <h1>User Registration Form</h1>\n <form>\n <input type=\...
Write an HTML page to display a form for user registration.
<!DOCTYPE html> <html> <head> <title>User Registration Form</title> </head> <body> <h1>User Registration Form</h1> <form> <input type="text" name="name" placeholder="Enter your name"> <input type="email" name="email" placeholder="Enter your email"> <input type="password" name="passwo...
[ { "role": "user", "content": "Write a JavaScript function to filter all numbers in an array and return a new array containing only the even numbers.\n\narr = [1, 2, 3, 4, 5, 6]" }, { "role": "assistant", "content": "function evenNumbers(arr) {\n return arr.filter(num => num % 2 === 0);\n}\n\n...
Write a JavaScript function to filter all numbers in an array and return a new array containing only the even numbers.
arr = [1, 2, 3, 4, 5, 6]
function evenNumbers(arr) { return arr.filter(num => num % 2 === 0); } evenNumbers(arr) # returns [2, 4, 6]
[ { "role": "user", "content": "Write a CSS code to make a header element bold" }, { "role": "assistant", "content": "h1 {\n font-weight: bold;\n}" } ]
Write a CSS code to make a header element bold
h1 { font-weight: bold; }
[ { "role": "user", "content": "Create a Django application to serve an API endpoint\n\nThe API endpoint should take an ID and return a user's name and age." }, { "role": "assistant", "content": "The output would involve creating a Django application with an API view that takes in the ID as the pa...
Create a Django application to serve an API endpoint
The API endpoint should take an ID and return a user's name and age.
The output would involve creating a Django application with an API view that takes in the ID as the parameter and returns a dictionary containing the user's name and age. The Django application should also include the necessary models and associated functions, a URL configuration, and a core application to be used in t...
[ { "role": "user", "content": "Write a Java program to add two large numbers of any length.\n\n12345 and 54321" }, { "role": "assistant", "content": "public static String addTwoLargeNumbers(String num1, String num2) { \n String result= \"\";\n \n // make sure num1 is negative and num2 is p...
Write a Java program to add two large numbers of any length.
12345 and 54321
public static String addTwoLargeNumbers(String num1, String num2) { String result= ""; // make sure num1 is negative and num2 is positive if (compareNumSize(num1, num2) < 0) return addTwoLargeNumbers(num2, num1); // variables to maintain the carry int carry = 0; // traver...
[ { "role": "user", "content": "Calculate the mean of a list of numbers.\n\nlst = [1, 2, 3, 4, 5]" }, { "role": "assistant", "content": "def calculate_mean(lst):\n return sum(lst) / len(lst)\n\nprint(calculate_mean([1, 2, 3, 4, 5]))" } ]
Calculate the mean of a list of numbers.
lst = [1, 2, 3, 4, 5]
def calculate_mean(lst): return sum(lst) / len(lst) print(calculate_mean([1, 2, 3, 4, 5]))
[ { "role": "user", "content": "How would you modify the following code to print the square of each number in the given list?\n\nnums = [1, 2, 3, 4]" }, { "role": "assistant", "content": "nums = [1, 2, 3, 4]\n\nfor i in range(len(nums)):\n nums[i] = nums[i] * nums[i]\n\nprint(nums) # [1, 4, 9, ...
How would you modify the following code to print the square of each number in the given list?
nums = [1, 2, 3, 4]
nums = [1, 2, 3, 4] for i in range(len(nums)): nums[i] = nums[i] * nums[i] print(nums) # [1, 4, 9, 16]
[ { "role": "user", "content": "Write an HTML web page that displays a list of three job titles and their corresponding descriptions.\n\nDeveloper\nDesigner\nProject Manager\n\nDeveloper: Responsible for developing applications based on customer requirements\nDesigner: Designs and implements user interfaces f...
Write an HTML web page that displays a list of three job titles and their corresponding descriptions.
Developer Designer Project Manager Developer: Responsible for developing applications based on customer requirements Designer: Designs and implements user interfaces for applications Project Manager: Manages the project's resources and timelines to ensure successful completion
<!DOCTYPE html> <html> <head> <title>Job Titles and Descriptions</title> </head> <body> <p> <ul> <li>Developer: Responsible for developing applications based on customer requirements</li> <li>Designer: Designs and implements user interfaces for applications</li> <li>Projec...
[ { "role": "user", "content": "Find the sum of factors of a given number." }, { "role": "assistant", "content": "def sum_factors(n):\n total = 0\n for i in range(1, n + 1):\n if n % i == 0:\n total += i\n return total\n\nsum_factors(12) # Output: 28" } ]
Find the sum of factors of a given number.
def sum_factors(n): total = 0 for i in range(1, n + 1): if n % i == 0: total += i return total sum_factors(12) # Output: 28
[ { "role": "user", "content": "Generate a program to get the min and max values from a list in one line." }, { "role": "assistant", "content": "def get_min_max(lst):\n return min(lst), max(lst)" } ]
Generate a program to get the min and max values from a list in one line.
def get_min_max(lst): return min(lst), max(lst)
[ { "role": "user", "content": "Find the position of the substring \"is\" in the string.\n\nstring = \"This is an example\"" }, { "role": "assistant", "content": "string = \"This is an example\"\nprint(string.find(\"is\"))" } ]
Find the position of the substring "is" in the string.
string = "This is an example"
string = "This is an example" print(string.find("is"))
[ { "role": "user", "content": "Using the list as an example, remove all elements from the list that have a value of 0.\n\nmy_list = [0, 5, 7, 0, 9]" }, { "role": "assistant", "content": "my_list = [5, 7, 9]\n \nmy_list = [0, 5, 7, 0, 9]\nmy_list = [x for x in my_list if x != 0]\nprint(my_list)" ...
Using the list as an example, remove all elements from the list that have a value of 0.
my_list = [0, 5, 7, 0, 9]
my_list = [5, 7, 9] my_list = [0, 5, 7, 0, 9] my_list = [x for x in my_list if x != 0] print(my_list)
[ { "role": "user", "content": "Convert the Python list below to a nested dictionary of countries and their populations.\n\nList = [[\"United_Kingdom\", 66_000_000],[\"United_States\", 323_000_000]]" }, { "role": "assistant", "content": "countries = {\n \"United_Kingdom\": 66_000_000,\n \"Un...
Convert the Python list below to a nested dictionary of countries and their populations.
List = [["United_Kingdom", 66_000_000],["United_States", 323_000_000]]
countries = { "United_Kingdom": 66_000_000, "United_States": 323_000_000 }
[ { "role": "user", "content": "Find the most occurring item from a given list.\n\ninput_list = [1,2,2,3,3,3,4,4,4,4]" }, { "role": "assistant", "content": "from collections import Counter\n\ninput_list = [1,2,2,3,3,3,4,4,4,4] \nmost_occurring_item = Counter(input_list).most_common(1)\nprint(most_...
Find the most occurring item from a given list.
input_list = [1,2,2,3,3,3,4,4,4,4]
from collections import Counter input_list = [1,2,2,3,3,3,4,4,4,4] most_occurring_item = Counter(input_list).most_common(1) print(most_occurring_item)
[ { "role": "user", "content": "Identify the language into which the given text is translated.\n\nText: いつもありがとう。" }, { "role": "assistant", "content": "The given text is translated into Japanese language." } ]
Identify the language into which the given text is translated.
Text: いつもありがとう。
The given text is translated into Japanese language.
[ { "role": "user", "content": "Write a function in JavaScript which takes a situation as a parameter and returns the probability of success.\n\nThe probability of the stock market rising tomorrow." }, { "role": "assistant", "content": "function findProbability(situation) {\n // code to calculate ...
Write a function in JavaScript which takes a situation as a parameter and returns the probability of success.
The probability of the stock market rising tomorrow.
function findProbability(situation) { // code to calculate probability return probability; }
[ { "role": "user", "content": "Given a dictionary, write a function to get all the keys with a given value.\n\nmy_dict = {'a': 1, 'b': 2, 'c': 2};" }, { "role": "assistant", "content": "def get_keys_by_value(my_dict, value):\n keys = []\n for k, v in my_dict.items():\n if v == value:\n ...
Given a dictionary, write a function to get all the keys with a given value.
my_dict = {'a': 1, 'b': 2, 'c': 2};
def get_keys_by_value(my_dict, value): keys = [] for k, v in my_dict.items(): if v == value: keys.append(k) return keys # Testing my_dict = {'a': 1, 'b': 2, 'c': 2} keys = get_keys_by_value(my_dict, 2) print("Keys with the value 2 are: ", keys)
[ { "role": "user", "content": "Determine if the given list is ascending or not.\n\nList: [5, 4, 3, 9, 8]" }, { "role": "assistant", "content": "False" } ]
Determine if the given list is ascending or not.
List: [5, 4, 3, 9, 8]
False
[ { "role": "user", "content": "Explain how to traverse a binary tree using breadth-first search (BFS)." }, { "role": "assistant", "content": "Breadth-first search (BFS) is a technique used to traverse a tree or graph. In BFS, nodes are visited layer by layer, moving across each level from left to...
Explain how to traverse a binary tree using breadth-first search (BFS).
Breadth-first search (BFS) is a technique used to traverse a tree or graph. In BFS, nodes are visited layer by layer, moving across each level from left to right. The algorithm traverses the tree level by level, beginning with the root node, then traversing the child nodes of the root, then traversing the grandchild no...
[ { "role": "user", "content": "Construct a class in Python that can calculate the volume of a cube given its side length." }, { "role": "assistant", "content": "class Cube(object):\n \n def __init__(self, side_length):\n self.side_length = side_length\n \n \n def calculate_v...
Construct a class in Python that can calculate the volume of a cube given its side length.
class Cube(object): def __init__(self, side_length): self.side_length = side_length def calculate_volume(self): return self.side_length * self.side_length * self.side_length
[ { "role": "user", "content": "Explain why we use a Dictionary instead of Lists when we need to store multiple pairs of data (key-value pair)?" }, { "role": "assistant", "content": "Lists are used to store an ordered collection of elements, but they are not suitable for storing key-value pairs of...
Explain why we use a Dictionary instead of Lists when we need to store multiple pairs of data (key-value pair)?
Lists are used to store an ordered collection of elements, but they are not suitable for storing key-value pairs of data because they don't provide an efficient way to look up values associated with specific keys. Dictionaries provide a more efficient way to store key-value pairs of data, as they use a hashmap underlyi...
[ { "role": "user", "content": "Compile a program to check whether an array is a subset of another array\n\nexample1 = [4, 5, 6]\nexample2 = [5, 6, 7]" }, { "role": "assistant", "content": "def is_subset(a, b): \n for i in a: \n if i not in b: \n return False \n return True...
Compile a program to check whether an array is a subset of another array
example1 = [4, 5, 6] example2 = [5, 6, 7]
def is_subset(a, b): for i in a: if i not in b: return False return True
[ { "role": "user", "content": "Generate a Java program to sort an array of n elements in ascending order" }, { "role": "assistant", "content": "public static void sort(int arr[]) \n{ \n int n = arr.length; \n \n // Build heap (rearrange array) \n for (int i = n / 2 - 1; i >= 0; i--) \n ...
Generate a Java program to sort an array of n elements in ascending order
public static void sort(int arr[]) { int n = arr.length; // Build heap (rearrange array) for (int i = n / 2 - 1; i >= 0; i--) heapify(arr, n, i); // One by one extract an element from heap for (int i=n-1; i>=0; i--) { // Move current root to end int temp =...
[ { "role": "user", "content": "Write a function in Python that takes two strings and returns a single string with the characters in alternating order.\n\n\"Hello\", \"World!\"" }, { "role": "assistant", "content": "def alternate_string(str1, str2):\n \"\"\"Return a string with characters in alte...
Write a function in Python that takes two strings and returns a single string with the characters in alternating order.
"Hello", "World!"
def alternate_string(str1, str2): """Return a string with characters in alternating order from two given strings.""" result = "" for i in range(min(len(str1), len(str2))): result += str1[i] + str2[i] result += str1[i + 1:] + str2[i + 1:] return result
[ { "role": "user", "content": "Manually calculate this equation: (5x + 6) / 3" }, { "role": "assistant", "content": "(5x + 6) / 3 = (5x/3) + (6/3) = (5/3)x + 2" } ]
Manually calculate this equation: (5x + 6) / 3
(5x + 6) / 3 = (5x/3) + (6/3) = (5/3)x + 2
[ { "role": "user", "content": "Compose a CSS 3D transformation to rotate an element by 45 degrees." }, { "role": "assistant", "content": "transform: rotate3d(0, 1, 0, 45deg);" } ]
Compose a CSS 3D transformation to rotate an element by 45 degrees.
transform: rotate3d(0, 1, 0, 45deg);
[ { "role": "user", "content": "Design a function to convert a ternary tree to a doubly linked list." }, { "role": "assistant", "content": "def convertTernaryTreeToDoublyLinkedList(root):\n # Edge case\n if (root == None):\n return \n \n # Create two empty lists to hold left and...
Design a function to convert a ternary tree to a doubly linked list.
def convertTernaryTreeToDoublyLinkedList(root): # Edge case if (root == None): return # Create two empty lists to hold left and right list of root left = [] right = [] # Add root to left list that will hold left subtree left.append(root.val) # Store the value of the root fo...
[ { "role": "user", "content": "Write a function to check if the given string `str1` is a permutation of the string `str2`\n\nstr1 = 'program'\nstr2 = 'gramopr'" }, { "role": "assistant", "content": "def is_permutation(str1, str2): \n \"\"\"\n Function to check if the given string str1 is a ...
Write a function to check if the given string `str1` is a permutation of the string `str2`
str1 = 'program' str2 = 'gramopr'
def is_permutation(str1, str2): """ Function to check if the given string str1 is a permutation of the string str2 Parameters: str1 (str): first string str2 (str): second string Returns: bool: True if str1 is a permutation of str2, False otherwise """ if (len(str1) !=...
[ { "role": "user", "content": "Create a one-click web button with the following properties: font size of 20px; font color rgb(255, 0, 128); background-color #6790FF" }, { "role": "assistant", "content": "<button style=\"font-size: 20px; color: rgb(255, 0, 128); background-color: #6790FF;\">Click ...
Create a one-click web button with the following properties: font size of 20px; font color rgb(255, 0, 128); background-color #6790FF
<button style="font-size: 20px; color: rgb(255, 0, 128); background-color: #6790FF;">Click Here</button>
[ { "role": "user", "content": "Create a dictionary containing the keys \"name\" and \"age\"." }, { "role": "assistant", "content": "my_dict = {\"name\": \"\", \"age\": 0}" } ]
Create a dictionary containing the keys "name" and "age".
my_dict = {"name": "", "age": 0}
[ { "role": "user", "content": "Create a JSON representation of a Person object.\n\n{\n name: \"John\",\n age: 25,\n address: \"123 Main Street\"\n}" }, { "role": "assistant", "content": "{\n \"name\": \"John\",\n \"age\": 25,\n \"address\": {\n \"street\": \"123 Main Street\"\n }\n}" } ]
Create a JSON representation of a Person object.
{ name: "John", age: 25, address: "123 Main Street" }
{ "name": "John", "age": 25, "address": { "street": "123 Main Street" } }
[ { "role": "user", "content": "Change the if-else statement to a switch statement.\n\nif (x == 0) {\n Console.WriteLine(\"Zero\");\n}\nelse if (x == 1) {\n Console.WriteLine(\"One\");\n}" }, { "role": "assistant", "content": "switch (x) {\n case 0:\n Console.WriteLine(\"Zero\");\n br...
Change the if-else statement to a switch statement.
if (x == 0) { Console.WriteLine("Zero"); } else if (x == 1) { Console.WriteLine("One"); }
switch (x) { case 0: Console.WriteLine("Zero"); break; case 1: Console.WriteLine("One"); break; }
[ { "role": "user", "content": "Design a MySQL table of 10 rows to store information about cities." }, { "role": "assistant", "content": "CREATE TABLE cities (\n city_id INT AUTO_INCREMENT PRIMARY KEY, \n city_name VARCHAR(255) NOT NULL, \n population INT NOT NULL,\n country VARCHAR(25...
Design a MySQL table of 10 rows to store information about cities.
CREATE TABLE cities ( city_id INT AUTO_INCREMENT PRIMARY KEY, city_name VARCHAR(255) NOT NULL, population INT NOT NULL, country VARCHAR(255), area INT );
[ { "role": "user", "content": "Write a code to check if the content of two strings is the same\n\nHello, World!\nHello World!" }, { "role": "assistant", "content": "if string1.replace(' ', '') == string2.replace(' ', ''):\n print(\"The strings have the same content\")\nelse: \n print(\"The ...
Write a code to check if the content of two strings is the same
Hello, World! Hello World!
if string1.replace(' ', '') == string2.replace(' ', ''): print("The strings have the same content") else: print("The strings do not have the same content")
[ { "role": "user", "content": "Describe a method for sorting a list of integers using selection sort.\n\nlist = [3, 6, 8, 9, 5]" }, { "role": "assistant", "content": "def selection_sort(list):\n # Traverse through all array elements \n for i in range(len(list)): \n \n # Find the...
Describe a method for sorting a list of integers using selection sort.
list = [3, 6, 8, 9, 5]
def selection_sort(list): # Traverse through all array elements for i in range(len(list)): # Find the minimum element in remaining # unsorted array min_idx = i for j in range(i+1, len(list)): if list[min_idx] > list[j]: min_idx = j ...
[ { "role": "user", "content": "Write a SQL query to find the customer id, name, and salary of the customers whose salary is in the range 2000-6000." }, { "role": "assistant", "content": "SELECT customer_id, customer_name, customer_salary \nFROM customers \nWHERE customer_salary >= 2000 AND custom...
Write a SQL query to find the customer id, name, and salary of the customers whose salary is in the range 2000-6000.
SELECT customer_id, customer_name, customer_salary FROM customers WHERE customer_salary >= 2000 AND customer_salary <= 6000;
[ { "role": "user", "content": "Assign a numerical value to a given string.\n\n\"Apple\"" }, { "role": "assistant", "content": "\"Apple\" = 1" } ]
Assign a numerical value to a given string.
"Apple"
"Apple" = 1
[ { "role": "user", "content": "Create a database table in SQL with two columns UserId and Username." }, { "role": "assistant", "content": "CREATE TABLE Users (\n UserId INT NOT NULL, \n Username VARCHAR(255) NOT NULL,\n PRIMARY KEY (UserId)\n);" } ]
Create a database table in SQL with two columns UserId and Username.
CREATE TABLE Users ( UserId INT NOT NULL, Username VARCHAR(255) NOT NULL, PRIMARY KEY (UserId) );
[ { "role": "user", "content": "How is AI used in finance?" }, { "role": "assistant", "content": "AI is being increasingly used in finance to improve the accuracy and speed of processes, make better-informed decisions, and streamline customer service. Financial institutions use AI to automate and ...
How is AI used in finance?
AI is being increasingly used in finance to improve the accuracy and speed of processes, make better-informed decisions, and streamline customer service. Financial institutions use AI to automate and speed up operations such as accounts payable and receivable, loans underwriting, money management, fraud detection, and ...
[ { "role": "user", "content": "Create a program that takes two inputs, an array of strings and an array of integers. Output an array with the strings at the same indices as the integers.\n\nString[] strings = {\"cat\", \"dog\", \"bird\", \"fish\"};\n int[] indices = {1, 0, 3, 2};" }, { "role": "as...
Create a program that takes two inputs, an array of strings and an array of integers. Output an array with the strings at the same indices as the integers.
String[] strings = {"cat", "dog", "bird", "fish"}; int[] indices = {1, 0, 3, 2};
String[] output = new String[4]; for(int i = 0; i < strings.length; i++) { output[indices[i]] = strings[i]; } System.out.println(Arrays.toString(output));
[ { "role": "user", "content": "Write a JavaScript function that takes an array and counts the occurence of each element in the array.\n\n[1, 4, 2, 4, 1]" }, { "role": "assistant", "content": "function countOccurences(arr){\n let count = {};\n arr.forEach(function(i) { count[i] = (count[i]||...
Write a JavaScript function that takes an array and counts the occurence of each element in the array.
[1, 4, 2, 4, 1]
function countOccurences(arr){ let count = {}; arr.forEach(function(i) { count[i] = (count[i]||0) + 1;}); return count; }
[ { "role": "user", "content": "Create a stored procedure in SQL for selecting all the records from a customers table." }, { "role": "assistant", "content": "CREATE PROCEDURE select_customers \nAS\nBEGIN\n SELECT * FROM customers;\nEND;" } ]
Create a stored procedure in SQL for selecting all the records from a customers table.
CREATE PROCEDURE select_customers AS BEGIN SELECT * FROM customers; END;
[ { "role": "user", "content": "Create a HTML form to allow users to enter an email address and a message." }, { "role": "assistant", "content": "<!DOCTYPE html>\n<html>\n<head>\n</head>\n<body>\n <form action=\"submit.php\" method=\"post\">\n Email: <input type=\"text\" name=\"email\">\n M...
Create a HTML form to allow users to enter an email address and a message.
<!DOCTYPE html> <html> <head> </head> <body> <form action="submit.php" method="post"> Email: <input type="text" name="email"> Message: <input type="text" name="message"> <input type="submit" value="Submit"> </form> </body> </html>
[ { "role": "user", "content": "Explain the concept of classes and objects in Java." }, { "role": "assistant", "content": "Classes in Java are user-defined templates for creating objects. A class specifies the data and behavior associated with any objects created from it. An object is an instance ...
Explain the concept of classes and objects in Java.
Classes in Java are user-defined templates for creating objects. A class specifies the data and behavior associated with any objects created from it. An object is an instance of a class which contains its own set of attributes and methods. Objects can interact with each other’s attributes and methods. Classes and objec...
[ { "role": "user", "content": "Generate the HTML output for a page that has a title of \"Welcome\" and a body with a single header of \"Hello World!\"." }, { "role": "assistant", "content": "<html>\n <head>\n <title>Welcome</title>\n </head>\n <body>\n <h1>Hello World!</h1>...
Generate the HTML output for a page that has a title of "Welcome" and a body with a single header of "Hello World!".
<html> <head> <title>Welcome</title> </head> <body> <h1>Hello World!</h1> </body> </html>
[ { "role": "user", "content": "Write an SQL query to return the names of workers whose salary is within the top 25% among all workers.\n\nTable Schema: \ntable_workers(id int, name varchar, salary int)" }, { "role": "assistant", "content": "SELECT name \nFROM table_workers\nWHERE salary >= (SELEC...
Write an SQL query to return the names of workers whose salary is within the top 25% among all workers.
Table Schema: table_workers(id int, name varchar, salary int)
SELECT name FROM table_workers WHERE salary >= (SELECT PERCENTILE_DISC(0.25) WITHIN GROUP (ORDER BY salary) FROM table_workers)
[ { "role": "user", "content": "Parse a given XML document using the ElementTree module.\n\n<note>\n <to>John</to>\n <from>Alice</from>\n <heading>Greeting</heading>\n <body>Hi John, how are you?</body>\n</note>" }, { "role": "assistant", "content": "import xml.etree.ElementTree as ET\n\ntree ...
Parse a given XML document using the ElementTree module.
<note> <to>John</to> <from>Alice</from> <heading>Greeting</heading> <body>Hi John, how are you?</body> </note>
import xml.etree.ElementTree as ET tree = ET.parse('data.xml') root = tree.getroot() for child in root: print(child.tag, child.attrib, child.text)
[ { "role": "user", "content": "Create a Python function that takes a list of strings and removes any words that include numbers.\n\nlist_of_strings = [\"hello123\", \"world456\", \"foo\", \"bar7\"]" }, { "role": "assistant", "content": "def remove_numbers_from_list(list_of_strings):\n '''This ...
Create a Python function that takes a list of strings and removes any words that include numbers.
list_of_strings = ["hello123", "world456", "foo", "bar7"]
def remove_numbers_from_list(list_of_strings): '''This function will take a list of strings and remove any words that include numbers.''' modified_list = [] for word in list_of_strings: if not any(char.isdigit() for char in word): modified_list.append(word) return modified_list ...
[ { "role": "user", "content": "Generate CNN-LSTM model in Keras." }, { "role": "assistant", "content": "# define CNN model\nmodel_cnn = Sequential([\n Conv2D(32, (3, 3), activation='relu', input_shape=(28, 28, 1)),\n MaxPool2D(),\n Flatten(),\n Dense(100, activation='relu'),\n Dens...
Generate CNN-LSTM model in Keras.
# define CNN model model_cnn = Sequential([ Conv2D(32, (3, 3), activation='relu', input_shape=(28, 28, 1)), MaxPool2D(), Flatten(), Dense(100, activation='relu'), Dense(10, activation='softmax') ]) # define RNN model model_lstm = Sequential() model_lstm.add(LSTM(128, input_shape=(28, 28, 32))) mode...
[ { "role": "user", "content": "Construct an if condition in Python to check if a given number is within the range of [2, 12]." }, { "role": "assistant", "content": "if 2 <= x <= 12:\n # do something" } ]
Construct an if condition in Python to check if a given number is within the range of [2, 12].
if 2 <= x <= 12: # do something
[ { "role": "user", "content": "Sort the following list in descending order.\n\nmy_list = [1, 5, 3, 7]" }, { "role": "assistant", "content": "my_list.sort(reverse=True)" } ]
Sort the following list in descending order.
my_list = [1, 5, 3, 7]
my_list.sort(reverse=True)
[ { "role": "user", "content": "Write a SQL query to select the row with the customer id \"CID001\" from the customers table." }, { "role": "assistant", "content": "SELECT * FROM customers WHERE customer_id = 'CID001';" } ]
Write a SQL query to select the row with the customer id "CID001" from the customers table.
SELECT * FROM customers WHERE customer_id = 'CID001';
[ { "role": "user", "content": "Manipulate a given list of strings to capitalize the first letter in each string.\n\nmylist = [\"this\", \"is\", \"a\", \"list\"]" }, { "role": "assistant", "content": "def capitalize(mylist):\n new_list = []\n \n for item in mylist:\n new_list.append(item.cap...
Manipulate a given list of strings to capitalize the first letter in each string.
mylist = ["this", "is", "a", "list"]
def capitalize(mylist): new_list = [] for item in mylist: new_list.append(item.capitalize()) return new_list print(capitalize(mylist)) #Output: ['This', 'Is', 'A', 'List']
[ { "role": "user", "content": "Explain how to perform a bubble sort on a given array." }, { "role": "assistant", "content": "// To perform a bubble sort on a given array:\n// 1. Iterate over the array and compare adjacent elements\n// 2. If the element on the left is greater than the element on t...
Explain how to perform a bubble sort on a given array.
// To perform a bubble sort on a given array: // 1. Iterate over the array and compare adjacent elements // 2. If the element on the left is greater than the element on the right, swap them // 3. After each pass, the largest element in the array will "bubble" up to the right // 4. Continue to iterate and swap until the...
[ { "role": "user", "content": "Parse a HTML page and find all text content within the page." }, { "role": "assistant", "content": "from bs4 import BeautifulSoup\n \nhtml_doc = \"\"\"\n<html><head><title>Page Title</title></head>\n<body>\n<h1>Header Text</h1>\n<p>Paragraph 1</p>\n<p>Paragraph 2</p...
Parse a HTML page and find all text content within the page.
from bs4 import BeautifulSoup html_doc = """ <html><head><title>Page Title</title></head> <body> <h1>Header Text</h1> <p>Paragraph 1</p> <p>Paragraph 2</p> </body> </html> """ soup = BeautifulSoup(html_doc, 'html.parser') text_content = soup.find_all(text=True) for content in text_content: print(content)
[ { "role": "user", "content": "Convert the given matrix into a comma-separated values (CSV) format.\n\n[[1, 2, 3], \n [4, 5, 6], \n [7, 8, 9]]" }, { "role": "assistant", "content": "1,2,3\n4,5,6\n7,8,9" } ]
Convert the given matrix into a comma-separated values (CSV) format.
[[1, 2, 3], [4, 5, 6], [7, 8, 9]]
1,2,3 4,5,6 7,8,9
[ { "role": "user", "content": "Write a JavaScript function that takes an argument and determines whether it is even or odd." }, { "role": "assistant", "content": "const evenOrOdd = (x) => {\n if (x % 2 == 0) {\n return 'even';\n } \n else {\n return 'odd';\n }\n}" } ]
Write a JavaScript function that takes an argument and determines whether it is even or odd.
const evenOrOdd = (x) => { if (x % 2 == 0) { return 'even'; } else { return 'odd'; } }
[ { "role": "user", "content": "Write a CSS rule to set a blue color for all text elements." }, { "role": "assistant", "content": "* {\n color: #0000ff;\n}" } ]
Write a CSS rule to set a blue color for all text elements.
* { color: #0000ff; }
[ { "role": "user", "content": "Create a C++ vector of strings containing names." }, { "role": "assistant", "content": "#include <iostream>\n#include <vector>\n#include <string>\n\nint main() {\n std::vector<std::string> names;\n names.push_back(\"John\");\n names.push_back(\"Paul\");\n names.push...
Create a C++ vector of strings containing names.
#include <iostream> #include <vector> #include <string> int main() { std::vector<std::string> names; names.push_back("John"); names.push_back("Paul"); names.push_back("Adam"); names.push_back("Linda"); names.push_back("James"); return 0; }
[ { "role": "user", "content": "Create a JavaScript object that contains a student's name, age, and courses." }, { "role": "assistant", "content": "let student = { \n name: \"John Doe\", \n age: 20, \n courses: [\"Math\", \"Physics\", \"English\"] \n};" } ]
Create a JavaScript object that contains a student's name, age, and courses.
let student = { name: "John Doe", age: 20, courses: ["Math", "Physics", "English"] };
[ { "role": "user", "content": "Re-implement this Ruby code in Python\n\ndef fibonacci(n)\n return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2)\nend" }, { "role": "assistant", "content": "def fibonacci(n): \n if n < 2: \n return n \n return fibonacci(n - 1) + fibonacci(n - 2) \n ...
Re-implement this Ruby code in Python
def fibonacci(n) return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2) end
def fibonacci(n): if n < 2: return n return fibonacci(n - 1) + fibonacci(n - 2) print(fibonacci(7)) # Outputs: 13
[ { "role": "user", "content": "Remove comments from a given HTML page." }, { "role": "assistant", "content": "def remove_comments(html_page):\n comment_start = \"<!--\"\n comment_end = \"-->\"\n output_page = \"\"\n while html_page:\n comment_start_index = html_page.find(comment_start)\n ...
Remove comments from a given HTML page.
def remove_comments(html_page): comment_start = "<!--" comment_end = "-->" output_page = "" while html_page: comment_start_index = html_page.find(comment_start) if comment_start_index == -1: output_page += html_page break output_page += html_page[:comment_start_index] html_page = htm...
[ { "role": "user", "content": "Write a Python code that prints out the following patterns:" }, { "role": "assistant", "content": "# Pattern 1\nfor i in range(1, 10):\n for j in range(1, i + 1):\n print(\"*\", end=\" \")\n print(\" \")\n\n# Pattern 2\nfor i in range(10, 0, -1):\n f...
Write a Python code that prints out the following patterns:
# Pattern 1 for i in range(1, 10): for j in range(1, i + 1): print("*", end=" ") print(" ") # Pattern 2 for i in range(10, 0, -1): for j in range(i, 0, -1): print("*", end=" ") print(" ")
[ { "role": "user", "content": "Write a Java program to print out the first n prime numbers" }, { "role": "assistant", "content": "public static void printPrimeNumbers(int n) \n { \n int num; \n int count=0;\n for (int i = 2; i <= n;) \n { \n num=0; \n ...
Write a Java program to print out the first n prime numbers
public static void printPrimeNumbers(int n) { int num; int count=0; for (int i = 2; i <= n;) { num=0; for (int j = 2; j <= i / 2; j++) { if (i % j == 0) { num++; br...
[ { "role": "user", "content": "Write a code snippet using Python to print the following sentence \"Programming is fun!\"." }, { "role": "assistant", "content": "print(\"Programming is fun!\")" } ]
Write a code snippet using Python to print the following sentence "Programming is fun!".
print("Programming is fun!")
[ { "role": "user", "content": "Write an SQL query to select all the records from a table named 'products' where the price is between 5 and 10." }, { "role": "assistant", "content": "SELECT * FROM products WHERE price BETWEEN 5 AND 10;" } ]
Write an SQL query to select all the records from a table named 'products' where the price is between 5 and 10.
SELECT * FROM products WHERE price BETWEEN 5 AND 10;
[ { "role": "user", "content": "Can you code a solution to Bubble Sort an array of integers?\n\n[5, 4, 3, 2, 1]" }, { "role": "assistant", "content": "def bubbleSort(arr): \n n = len(arr)\n \n # Traverse through all array elements \n for i in range(n): \n \n # Last i elements are...
Can you code a solution to Bubble Sort an array of integers?
[5, 4, 3, 2, 1]
def bubbleSort(arr): n = len(arr) # Traverse through all array elements for i in range(n): # Last i elements are already in place for j in range(0, n-i-1): # traverse the array from 0 to n-i-1 # Swap if the element found is greater # than t...
[ { "role": "user", "content": "Write a function in Java to instantiate an Employee class with a given name and age." }, { "role": "assistant", "content": "public class Employee {\n\tprivate String name;\n\tprivate int age;\n\t\n\tpublic Employee(String name, int age) {\n\t\tthis.name = name;\n\t\...
Write a function in Java to instantiate an Employee class with a given name and age.
public class Employee { private String name; private int age; public Employee(String name, int age) { this.name = name; this.age = age; } public String getName() { return name; } public int getAge() { return age; } public void setName(String name) { this.name = name; } public void setAge(...
[ { "role": "user", "content": "Write a SQL query to update the value of column b in the table called a.\n\nTable name: a\nColumns: a, b\n\nCurrent state of table a:\na | b\n1 | 10\n2 | 11\n3 | 12" }, { "role": "assistant", "content": "UPDATE a\nSET b = 20\nWHERE a = 3;" } ]
Write a SQL query to update the value of column b in the table called a.
Table name: a Columns: a, b Current state of table a: a | b 1 | 10 2 | 11 3 | 12
UPDATE a SET b = 20 WHERE a = 3;
[ { "role": "user", "content": "Write a Tensorflow code for building a neural network with two input layers, two hidden layers and one output layer." }, { "role": "assistant", "content": "model = tf.keras.models.Sequential([\n tf.keras.layers.Dense(64, activation='relu', input_shape=[2]),\n ...
Write a Tensorflow code for building a neural network with two input layers, two hidden layers and one output layer.
model = tf.keras.models.Sequential([ tf.keras.layers.Dense(64, activation='relu', input_shape=[2]), tf.keras.layers.Dense(64, activation='relu'), tf.keras.layers.Dense(64, activation='relu'), tf.keras.layers.Dense(1) ])
[ { "role": "user", "content": "Given two strings, write a Python function that finds the common letters between them.\n\nString 1: apple\nString 2: oranges" }, { "role": "assistant", "content": "def find_common_letters(s1, s2):\n letters = set()\n\n for letter in s1:\n if letter in s...
Given two strings, write a Python function that finds the common letters between them.
String 1: apple String 2: oranges
def find_common_letters(s1, s2): letters = set() for letter in s1: if letter in s2: letters.add(letter) return letters # Example s1 = 'apple' s2 = 'oranges' print(find_common_letters(s1, s2)) # Output: {'a', 'e'}
[ { "role": "user", "content": "Write a function in C++ to reverse a C-style String.\n\n// str is a c-style string\nchar str[] = \"Hello World!\"" }, { "role": "assistant", "content": "void ReverseString(char *str)\n{ \n int length = 0; \n char temp; \n\n // calculate the length of string...
Write a function in C++ to reverse a C-style String.
// str is a c-style string char str[] = "Hello World!"
void ReverseString(char *str) { int length = 0; char temp; // calculate the length of string while (*str != 0) { length++; str++; } // the end of string str--; // swap first and last characters for (int i = 0; i < length/2; i++) { temp ...
[ { "role": "user", "content": "Write a SQL query to produce a list of customer names from the following table.\n\nTable: customers \n\n| customer_id | name |\n| --------- | ----- | \n| 1 | Bill |\n| 2 | Jane |\n| 3 | John |" }, { "role": "assistant", "content": "SELECT...
Write a SQL query to produce a list of customer names from the following table.
Table: customers | customer_id | name | | --------- | ----- | | 1 | Bill | | 2 | Jane | | 3 | John |
SELECT name FROM customers;