← 목록

Synth · CodeAlpaca일부

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

[output] | <input type="text" name="name" required> [instruction] | Write an Angular directive to make a text field required. [input] | <input type="text" name="name">

[output] | <?xml version="1.0" encoding="UTF-8"?> <information> <img /> <property> <name>Adobe</name> <type>Software</type> </property> </information> [instruction] | Add a tag 'img' in the following xml document. [input] | <?xml version="1.0" encoding="UTF-8"?> <information> <property> <name>Adobe</name> <type>Software</type> </property> </information>

[output] | The HTML element for displaying a hyperlink is 'a'. [instruction] | Identify the HTML element for displaying a hyperlink. [input] |

[output] | "First_Name,Last_Name,Age" [instruction] | Format the following string according to the specified condition. [input] | String: "first_name,last_name,age" Condition: each word should have its first letter capitalized

[output] | A HashMap can be used to store the data structure. It uses the numbers as the key, and their frequency could be the value associated with the key. [instruction] | Design a data structure to store a list of numbers and the corresponding and their frequencies. [input] |

[output] | int main() { printf("Hello World!"); // added missing closing quotation mark } [instruction] | Insert a code line in the existing program to fix a syntax error. [input] | int main() { printf("Hello World!); }

[output] | ^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$ [instruction] | Generate a regex for email validation [input] |

[output] | p { box-shadow: 5px 5px 10px 0 rgba(0,0,0,0.75); } [instruction] | Write a css code to put a shadow on all the paragraphs [input] |

[output] | printf("Hello World!"); printf("Hello Python!"); [instruction] | Add a blank line between the two following lines of code. [input] | printf("Hello World!"); printf("Hello Python!");

[output] | public class myClass { private int myField1; private string myField2; public void myMethod() { Console.WriteLine("myMethod is called"); } public int MyProperty { get { return myField1; } set { myField1 = value; } } } [instruction] | Create a C# class that contains two private fields, one public method, and one property. [input] |

[output] | SELECT country, COUNT(*) FROM student_records GROUP BY country; [instruction] | Create a MySQL query to group a table of student records by their country of origin. [input] |

[output] | <form> <div class="form-row"> <div class="col-6"> <label for="name">Name</label> <input type="text" name="name" id="name"> </div> <div class="col-6"> <label for="email">Email Address</label> <input type="text" name="email" id="email"> </div> </div> <div [instruction] | Construct an HTML form with 10 fields, one for each of the following: name, email address, age, gender, job title, phone number, address, city, state, and zip code. [input] |

[output] | class ExampleClass def initialize(arg1, arg2) @arg1 = arg1 @arg2 = arg2 end end [instruction] | Create a Ruby class that accepts two arguments in its constructor. [input] |

[output] | class Person: def __init__(self, name, age): self.name = name self.age = age [instruction] | Create a class called 'Person' which has a constructor which creates a person with given name and age. [input] |

[output] | def character_frequency(word): freq_dict = {} for char in word: if char in freq_dict: freq_dict[char] += 1 else: freq_dict[char] = 1 return freq_dict word = 'Python' print(character_frequency(word)) # {'P': 1, 'y': 1, 't': 1, 'h': 1, 'o': 1, 'n': [instruction] | Produce a program to print out the frequency of characters in a word. [input] | Python

[output] | import re binary_regex = r'^[01]+$' [instruction] | Form a regex expression which determines if a binary number is valid. [input] |

[output] | def sum_special(arr): temp = 0 for i in range(len(arr)): for j in range(i+1, len(arr)): temp += arr[i] * arr[j] return temp [instruction] | Re-write the following method to use a single loop instead of two. [input] | def sum_special(arr): temp = 0 for i in range(len(arr)): for j in range(i+1, len(arr)): temp += arr[i] * arr[j] return temp

[output] | numbers = [] for i in range(1, 6): numbers.append(i) print(numbers) [instruction] | Suggest a Python code to create a list containing the first five positive numbers. [input] |

[output] | <table> <tr> <th>ID</th> <th>Name</th> <th>Group</th> </tr> </table> [instruction] | Write an HTML code to create a table with three columns containing the headers "ID", "Name", and "Group". [input] |

[output] | numbers = [1, 2, 3, 4, 5, 6, 7, 8] new_list = [num for num in numbers if num % 2 != 0] print(new_list) [instruction] | Suggest a Python code to filter a list of numbers so that all even numbers are removed. [input] |

[output] | h2 { font-weight: bold; color: red; } [instruction] | Write a CSS code to make all h2 headings bold and red. [input] |

[output] | function validateUsername(username) { const pattern = /^[a-zA-Z0-9]*$/; return username.match(pattern); } [instruction] | Suggest a JavaScript code to validate a username if it contains only alphabets and digits while ignoring the special characters. [input] |

[output] | $students = [ [ 'name' => 'John Doe', 'age' => 22, 'marks' => 91 ], [ 'name' => 'Jane Doe', 'age' => 21, 'marks' => 87 ], // ... ]; $html = "<table> <tr> <th>Name</th> <th>Age</th> <th>Marks</th> </t [instruction] | Write a PHP program to build a dynamic HTML table with the details of 10 students. [input] |

[output] | import re string = "This is a programming task" pattern = r"is" if re.search(pattern, string): print("Match found") else: print("No match found") [instruction] | Suggest a Python code to match the substring "is" in the given string "This is a programming task". [input] |

[output] | let randomIntegersArray = []; for (let i = 0; i < 50; i++) { randomIntegersArray.push(Math.floor(Math.random() * (50 - 1 + 1)) + 1); } [instruction] | Generate an array of random integers between 1 and 50 inclusive. [input] |

[output] | let obj = { key1: "value1", key2: "value2", key3: "value3", key4: "value4" }; [instruction] | Create an object in JavaScript that has four properties and four associated values. [input] |

[output] | CREATE TABLE mytable ( id INTEGER NOT NULL, name VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, age INTEGER NOT NULL, PRIMARY KEY(id) ); [instruction] | Create an SQL table with four columns and necessary parameters. [input] |

[output] | def remove_last_two(s): return s[:-2] [instruction] | Create a function that takes in a string and returns the string without its last two letters. [input] | "Hello World!"

[output] | def find_longest_seq(arr): max_len = 0 curr_seq = [] for num in arr: if not curr_seq or num == curr_seq[-1] + 1: curr_seq.append(num) max_len = max(max_len, len(curr_seq)) else: curr_seq = [num] return max_len [instruction] | Write a code to find the longest consecutive sequence inside of a given list of numbers. [input] | [1, 3, 5, 7, 8, 2, 4, 9]

[output] | class Rectangle: def __init__(self, length, width): self.length = length self.width = width [instruction] | Write a Python class for a Rectangle object with two instance attributes, length and width. [input] |

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