← 목록

Synth · CodeAlpaca일부

총 20,022개 · 페이지 353/668
🔀 랜덤
불러오는 중…

[output] | positive [instruction] | Categorize a given tweet. [input] | "This new software program is supposed to make life so much easier!"

[output] | Syntax error. The function name is missing a single letter "s", it should be "print_message". [instruction] | Identify the type of bug for the following code snippet. [input] | def print_message(messsage): print("My message is: " + message)

[output] | const add = (a, b) => { return a + b; }; const average = (a, b) => { return (a + b) / 2; }; [instruction] | Add a function to the following Javascript code so that it calculates the average of the two numbers. [input] | const add = (a, b) => { return a + b; };

[output] | class Node: def __init__(self, data): self.data = data self.next = None def getData(self): return self.data [instruction] | Suggest an additional function needed to complete the following programme. [input] | class Node: def __init__(self, data): self.data = data self.next = None

[output] | The section of the code that must be changed is: std:cout << "Hello World!"; The correct expression should be: std::cout << "Hello World!"; [instruction] | Select what section of the code must be changed for the following C++ code snippet to compile correctly. [input] | int main() { std:cout << "Hello World!"; return 0; }

[output] | .image-box { display: inline-block; width: 100px; height: 100px; background-image: url("logo.png"); background-size: contain; } [instruction] | Suggest a change to render the following CSS code more efficient. [input] | .image-box { display: block; width: 100px; height: 100px; background-image: url("logo.png"); }

[output] | A variable declaration statement is a line of code that assigns a value to a variable name. [instruction] | Describe in one sentence what a variable declaration statement is. [input] |

[output] | list_of_strings.sort() # Sorts the list in alphabetical order [instruction] | Suggest a solution to the following problem: Write a program to sort a list of strings in alphabetical order. [input] | list_of_strings = ['banana', 'apple', 'orange', 'kiwi']

[output] | def cube(n): return n**3 [instruction] | Create a function to find cube of any number [input] |

[output] | unique_nums = set(list_of_nums) # {2, 3, 5, 7, 8} [instruction] | Extract the unique elements from a given list of numbers [input] | list_of_nums = [5, 2, 5, 3, 7, 8, 2]

[output] | The purpose of the try-except block is to handle exceptions that may be raised while a program is executing, so as to avoid crashing of the program. [instruction] | Explain what is the purpose of the try-except block [input] |

[output] | def compareStrings(string1, string2): if(string1 == string2): return 0 elif(string1 > string2): return 1 else: return -1 [instruction] | Define a function to compare two strings [input] |

[output] | SELECT name, address, age FROM employees WHERE age > 25; [instruction] | Construct a SQL query to get the names, address and age of employees with age more than 25. [input] |

[output] | Function CompareStrings(str1, str2) if Length(str1) > Length(str2) return str1 else return str2 End Function [instruction] | Write a pseudocode to compare two strings and determine which is longer. [input] |

[output] | def Fibonacci(n): a = 0 b = 1 if n < 0: print("Incorrect input") elif n == 0: return a elif n == 1: return b else: for i in range(2,n): c = a + b a = b b = c return b [instruction] | Implement a function to generate the Fibonacci series upto 'n' terms. [input] | n = 10

[output] | title: My Amazing Website [instruction] | Parse the given markup language to extract out the attributes and their corresponding values. [input] | <html> <head> <title>My Amazing Website</title> </head> </html>

[output] | A deadlock occurs in a multithreaded program when two or more threads are blocked from accessing a resource, because each thread is waiting for a resource that is being held by one of the other threads. This results in all threads being stuck, unable to proceed. [instruction] | Explain the purpose of a deadlock in a multithreaded program. [input] |

[output] | def c2f(temp): return ((9/5)*temp + 32) [instruction] | Modify the given code to accept input in Celsius and convert it to Fahrenheit. [input] | def c2f(): return ((9/5)*temp + 32)

[output] | num = int(input('Enter a number:')) print(num*3) [instruction] | Write code to times the number entered by the user by 3. [input] |

[output] | x_n+1 = x_n - f(x_n) / f'(x_n) x_0 = 100 x_1 = 50 - (50*50 - 100) / (2*50) = 50 - (2500 - 100) / 100 = 50 - 24 / 100 = 26 x_2 = 26 - (26*26 - 100) / (2*26) = 26 - (676 - 100) / 52 = 26 - 576 / 52 = 10 x_3 = 10 - (10*10 - 100) / (2*10) = 10 - (100 - 100) / 20 = 10 - 0 [instruction] | Find the square root of the given number using the Newton-Raphson method. [input] | Number: 100

[output] | 48 65 6c 6c 6f 20 57 6f 72 6c 64 21 [instruction] | Identify the byte sequence that produces the following output. [input] | Hello World!

[output] | ^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$ [instruction] | Create a Regular Expression to match URLs [input] |

[output] | list = [x.upper() for x in list] [instruction] | Modify the given code snippet to make all elements of the list uppercase. [input] | list = ["hello", "world"]

[output] | Deadlock is a situation in an operating system where two or more processes are unable to move forward due to the resources already being used by some of the other processes. This is a state of equilibrium where no progress can be made in executing the processes due to a circular wait for resources. [instruction] | What is deadlock in operating system? [input] |

[output] | Direct speech. [instruction] | Classify the following sentence according to the type of speech it is. [input] | John said: "Let's go to the zoo."

[output] | \w+ing$ [instruction] | Write a Regular Expression to identify all words that end with "ing". [input] |

[output] | list1 = list(set(list1)) [instruction] | Erase the duplicated elements of a list. [input] | list1 = [13, 15, 16, 18, 15, 20, 17]

[output] | def add(num1, num2): result = num1 + num2 return result [instruction] | Convert the following code snippet into a function. [input] | num1 = 4 num2 = 6 result = num1 + num2

[output] | A sparse matrix can be represented using a hashmap (dictionary) data structure. The hashmap will contain the non-zero elements of the matrix, where each entry will include the row index, column index and the value at that location. This helps in storing and retrieving massive amounts of data in an e [instruction] | What data structure do you choose to represent a sparse matrix in programming? [input] |

[output] | javac HelloWorld.java [instruction] | Compile a java program that prints out "Hello World!" [input] |

← → 방향키로 페이지 이동 · 숫자 입력 후 Enter로 점프