[User] I want to check whether a number is prime using Python.

[Assistant]
def is_prime(n):
    if n < 2:
        return False
    for i in range(2, int(n**0.5) + 1):
        if n % i == 0:
            return False
    return True


[User] I need a JavaScript function that debounces another function call.

[Assistant]
function debounce(fn, delay) {
    let timer;
    return function(...args) {
        clearTimeout(timer);
        timer = setTimeout(() => fn.apply(this, args), delay);
    };
}


[User] I would like to check if a value exists inside a slice in Go.

[Assistant]
func contains(arr []int, val int) bool {
    for _, v := range arr {
        if v == val {
            return true
        }
    }
    return false
}


[User] Can you show me how to write a recursive factorial function in Rust?

[Assistant]
fn factorial(n: u64) -> u64 {
    if n == 0 { return 1; }
    n * factorial(n - 1)
}


[User] I want to implement factorial using recursion in C++.

[Assistant]
int factorial(int n) {
    if (n == 0) return 1;
    return n * factorial(n - 1);
}


[User] Please generate Fibonacci numbers using Python in a simple loop.

[Assistant]
def fib(n):
    a, b = 0, 1
    for _ in range(n):
        print(a)
        a, b = b, a + b


[User] How can I calculate factorial recursively in Java?

[Assistant]
int factorial(int n) {
    if (n == 0) return 1;
    return n * factorial(n - 1);
}


[User] I want to determine if a number is even using JavaScript.

[Assistant] const isEven = n => n % 2 === 0;


[User] Show me how to merge two Python lists together.

[Assistant] merged = list1 + list2


[User] How do I find duplicate email addresses using SQL?

[Assistant] SELECT email, COUNT(*) FROM users GROUP BY email HAVING COUNT(*) > 1;


[User] I need a recursive factorial function in C#.

[Assistant]
int Factorial(int n) {
    if (n == 0) return 1;
    return n * Factorial(n - 1);
}


[User] Please show me how to compute factorial in Go using recursion.

[Assistant]
func factorial(n int) int {
    if n == 0 {
        return 1
    }
    return n * factorial(n - 1)
}


[User] I want to check if a string is a palindrome in Python.

[Assistant]
def is_palindrome(s):
    return s == s[::-1]


[User] Show me a JavaScript function that checks for palindrome strings.

[Assistant] const isPalindrome = s => s === s.split('').reverse().join('');


[User] I want to determine if a number is even in Rust.

[Assistant]
fn is_even(n: i32) -> bool {
    n % 2 == 0
}


[User] I need a C++ function that checks if a number is prime.

[Assistant]
bool isPrime(int n) {
    if (n < 2) return false;
    for (int i = 2; i * i <= n; i++) {
        if (n % i == 0) return false;
    }
    return true;
}


[User] How can I find the maximum of three numbers in Python?

[Assistant] max(a, b, c)


[User] Show me how to reverse a string in Java.

[Assistant]
boolean isPalindrome(String s) {
    return new StringBuilder(s).reverse().toString().equals(s);
}


[User] I want to reverse a string using Go.

[Assistant]
func reverse(s string) string {
    r := []rune(s)
    for i, j := 0, len(r)-1; i < j; i, j = i+1, j-1 {
        r[i], r[j] = r[j], r[i]
    }
    return string(r)
}


[User] Please show me how to get the maximum salary from a SQL table.

[Assistant] SELECT MAX(salary) FROM employees;


[User] I want to merge two dictionaries in Python.

[Assistant] merged = {**dict1, **dict2}


[User] How can I remove an item from a JavaScript array?

[Assistant] arr = arr.filter(x => x !== item);


[User] I need to sum an array in Rust.

[Assistant]
fn sum(arr: &[i32]) -> i32 {
    arr.iter().sum()
}


[User] Show me how to sum an array in C#.

[Assistant] int sum = arr.Sum();


[User] I want to count vowels in a Python string.

[Assistant]
def count_vowels(s):
    return sum(1 for c in s.lower() if c in 'aeiou')


[User] How can I count vowels using Java streams?

[Assistant] long count = s.chars().filter(c -> "aeiou".indexOf(c) != -1).count();


[User] I want to calculate factorial iteratively in Go.

[Assistant]
func factorial(n int) int {
    result := 1
    for i := 2; i <= n; i++ {
        result *= i
    }
    return result
}


[User] Show me how to calculate average salary using SQL.

[Assistant] SELECT AVG(salary) FROM employees;


[User] I need to find the minimum value in a Python list.

[Assistant] min(my_list)


[User] How can I find the maximum value in a JavaScript array?

[Assistant] Math.max(...arr)


[User] I want to get the length of a string in Rust.

[Assistant] let len = s.len();


[User] Show me how to get string length in C++.

[Assistant] int len = str.length();


[User] I want to square every number in a Python list.

[Assistant] list(map(lambda x: x*x, my_list))


[User] How can I sum an array using Java streams?

[Assistant] int sum = Arrays.stream(arr).sum();


[User] I want to create a map in Go with string keys and integer values.

[Assistant] m := map[string]int{"a": 1, "b": 2}


[User] Show me how to join two tables in SQL.

[Assistant] SELECT * FROM a JOIN b ON a.id = b.id;


[User] I want to flatten a nested list in Python.

[Assistant] [item for sublist in list_of_lists for item in sublist]


[User] How can I flatten an array in JavaScript?

[Assistant] arr.flat()


[User] Print hello world using Rust.

[Assistant] println!("Hello");


[User] I want to reverse a string in C#.

[Assistant] new string(s.Reverse().ToArray());


[User] Generate a list of numbers from 0 to 9 in Python.

[Assistant] list(range(10))


[User] Show me how to reverse a string in Java.

[Assistant] new StringBuilder(s).reverse().toString();


[User] I want to handle errors in Go properly.

[Assistant]
if err != nil {
    log.Fatal(err)
}


[User] How can I delete duplicate rows in SQL?

[Assistant] DELETE FROM users WHERE id NOT IN (SELECT MIN(id) FROM users GROUP BY email);


[User] I want to zip two lists in Python.

[Assistant] list(zip(list1, list2))


[User] Show me how to sort an array in JavaScript.

[Assistant] arr.sort((a, b) => a - b);


[User] I want to push a value into a Rust vector.

[Assistant] vec.push(10);


[User] Show me how to push an element into a C++ vector.

[Assistant] v.push_back(10);


[User] I want to check if a Python list is sorted.

[Assistant]
def is_sorted(lst):
    return lst == sorted(lst)


[User] I want to check if a JavaScript array contains a value.

[Assistant] arr.includes(value)


[User] Show me how to reverse a slice in Go.

[Assistant]
for i, j := 0, len(arr)-1; i < j; i, j = i+1, j-1 {
    arr[i], arr[j] = arr[j], arr[i]
}


[User] I want to check if a string contains text in Rust.

[Assistant] s.contains("text")


[User] Show me how to check if a C++ vector is empty.

[Assistant]
if (v.empty()) {
    // empty
}


[User] I want to compute the sum of a list in Python.

[Assistant] sum(my_list)


[User] I want to check for null values in Java.

[Assistant]
if (obj == null) {
    // handle
}


[User] Show me how to order SQL results by salary descending.

[Assistant] SELECT * FROM employees ORDER BY salary DESC;


[User] I want to convert a string to uppercase in JavaScript.

[Assistant] str.toUpperCase()


[User] I want to convert a string to lowercase in Python.

[Assistant] str.lower()


[User] Show me how to convert a string to int in Go.

[Assistant] i, _ := strconv.Atoi(str)


[User] I want to parse a string into an integer in Rust.

[Assistant] let num: i32 = s.parse().unwrap();


[User] Show me how to convert an int to string in C#.

[Assistant] x.ToString();


[User] I want to get the absolute value in Python.

[Assistant] abs(x)


[User] Show me absolute value in JavaScript.

[Assistant] Math.abs(x)


[User] I want to get absolute value in Java.

[Assistant] Math.abs(x);


[User] Show me how to loop through a range in Python.

[Assistant]
for i in range(10):
    print(i)


[User] I want to loop in Go.

[Assistant]
for i := 0; i < 10; i++ {
    fmt.Println(i)
}


[User] Show me how to break a loop in Rust.

[Assistant]
for i in 0..10 {
    if i == 5 {
        break;
    }
}


[User] I want a for loop in C++.

[Assistant]
for (int i = 0; i < 10; i++) {
    cout << i;
}


[User] Show me how to enumerate a list in Python.

[Assistant]
for i, v in enumerate(my_list):
    print(i, v)


[User] I want to use forEach in JavaScript.

[Assistant] arr.forEach(x => console.log(x));


[User] Show me how to select distinct values in SQL.

[Assistant] SELECT DISTINCT column_name FROM table;


[User] I want to get dictionary keys in Python.

[Assistant] my_dict.keys()


[User] Show me how to create a HashMap in Java.

[Assistant] Map<String, Integer> map = new HashMap<>();


[User] I want to append to a slice in Go.

[Assistant] arr = append(arr, 10)


[User] Show me how to get vector length in Rust.

[Assistant] vec.len()


[User] I want to add an item to a C# list.

[Assistant] list.Add(item);


[User] Show me how to check if a key exists in a Python dictionary.

[Assistant] key in my_dict


[User] I want to get object keys in JavaScript.

[Assistant] Object.keys(obj)


[User] Show me how to create a SQL table.

[Assistant] CREATE TABLE users (id INT, name TEXT);


[User] I want to zip two lists in Python again.

[Assistant] list(zip(a, b))


[User] Show me how to check a map key in Go.

[Assistant] val, ok := m[key]


[User] I want to use if let in Rust.

[Assistant]
if let Some(x) = option {
    println!("{}", x);
}


[User] Show me an if statement in C++.

[Assistant]
if (x > 0) {
    cout << x;
}


[User] I want to raise an error in Python.

[Assistant] raise ValueError("error")


[User] Show me how to throw an error in JavaScript.

[Assistant] throw new Error('error');


[User] I want to throw an exception in Java.

[Assistant] throw new Exception("error");


[User] Show me SQL group by usage.

[Assistant] SELECT department, COUNT(*) FROM employees GROUP BY department;


[User] I want to filter an array in JavaScript.

[Assistant] arr.filter(x => x > 0)


[User] Show me reduce in JavaScript.

[Assistant] arr.reduce((a, b) => a + b, 0)


[User] I want to initialize a struct in Go.

[Assistant] p := Person{Name: "John"}


[User] Show me a struct in Rust.

[Assistant]
struct Person {
    name: String,
}


[User] I want to define a class in C#.

[Assistant]
class Person {
    public string Name;
}


[User] Show me how to create a set in Python.

[Assistant] my_set = {1, 2, 3}


[User] I want to create a set in Java.

[Assistant] Set<Integer> set = new HashSet<>();


[User] Show me a set in JavaScript.

[Assistant] const set = new Set([1,2,3]);


[User] I want to limit SQL results.

[Assistant] SELECT * FROM users LIMIT 10;


[User] Show me how to check empty string in Python.

[Assistant]
if not s:
    print("empty")


[User] I want to handle errors in Go.

[Assistant]
if err != nil {
    log.Fatal(err)
}


[User] Show me error handling in Rust.

[Assistant]
match result {
    Ok(v) => v,
    Err(e) => panic!("error"),
}


[User] I need a Python example that checks whether a string is empty or not.

[Assistant]
if not s:
    print("string is empty")


[User] Show me how to find the length of a list in Python using built-in functions.

[Assistant] len(my_list)


[User] I want a JavaScript example for checking if an array is empty.

[Assistant] arr.length === 0


[User] Can you demonstrate how to convert a string to an integer in Python?

[Assistant] int(s)


[User] I need a Rust snippet that parses a string into an integer safely.

[Assistant] let num: i32 = s.parse().unwrap();


[User] Show me how to compute the absolute value of a number in JavaScript.

[Assistant] Math.abs(x)


[User] I want to loop over a list in Python and print each element.

[Assistant]
for item in my_list:
    print(item)


[User] Demonstrate how to create an empty dictionary in Python.

[Assistant] my_dict = {}


[User] I need a SQL query that selects all records from a table.

[Assistant] SELECT * FROM table_name;


[User] Show me how to sort a list in Python in ascending order.

[Assistant] sorted(my_list)


[User] I want a Java example that checks if a string is null.

[Assistant]
if (s == null) {
    // handle null
}


[User] How can I reverse a list in Python without using reverse()?.

[Assistant] my_list[::-1]


[User] Show me how to append an element to a Python list.

[Assistant] my_list.append(10)


[User] I need a Go example for iterating over a slice.

[Assistant]
for i, v := range arr {
    fmt.Println(i, v)
}


[User] Demonstrate how to check if a number is negative in Python.

[Assistant] n < 0


[User] I want a C++ example for declaring an array.

[Assistant] int arr[5] = {1,2,3,4,5};


[User] Show me how to concatenate strings in Python.

[Assistant] a + b


[User] I need a JavaScript way to convert a string to lowercase.

[Assistant] str.toLowerCase()


[User] How do I generate a random number in Python?

[Assistant]
import random
random.randint(1, 100)


[User] I want to check if a list contains a value in Python.

[Assistant] value in my_list


[User] Show me how to remove whitespace from a string in Python.

[Assistant] s.strip()


[User] I need a Java example for creating a list.

[Assistant] List<Integer> list = new ArrayList<>();


[User] Show me how to get the first element of a list in Python.

[Assistant] my_list[0]


[User] I want a Rust example for checking if a vector is empty.

[Assistant] vec.is_empty()


[User] Show me how to define a function in Python that adds two numbers.

[Assistant]
def add(a, b):
    return a + b


[User] I need a JavaScript function that multiplies two numbers.

[Assistant]
function multiply(a, b) {
    return a * b;
}


[User] Show me how to calculate power in Python using built-in operators.

[Assistant] a ** b


[User] I want a Go example for checking if a map contains a key.

[Assistant] value, ok := m[key]


[User] Show me how to format a string in Python using f-strings.

[Assistant] f"Hello {name}"


[User] I need a SQL query that counts rows in a table.

[Assistant] SELECT COUNT(*) FROM table_name;


[User] Show me how to convert a list to a set in Python.

[Assistant] set(my_list)


[User] I want a Java example for looping through an array.

[Assistant]
for (int i = 0; i < arr.length; i++) {
    System.out.println(arr[i]);
}


[User] Show me how to check if a string contains a substring in JavaScript.

[Assistant] s.includes("text")


[User] I need a Python example that finds the max value in a list.

[Assistant] max(my_list)


[User] Show me how to remove an element from a Python list by value.

[Assistant] my_list.remove(value)


[User] I want a C# example for creating a list of strings.

[Assistant] List<string> list = new List<string>();


[User] Show me how to check if a number is zero in Python.

[Assistant] n == 0


[User] I need a Go example for printing to console.

[Assistant] fmt.Println("Hello")


[User] Show me how to convert a string to uppercase in Python.

[Assistant] s.upper()


[User] I want a JavaScript example for filtering an array.

[Assistant] arr.filter(x => x > 0)


[User] Show me how to compute factorial using a loop in Python.

[Assistant]
result = 1
for i in range(1, n+1):
    result *= i


[User] I need a Rust example for pushing to a vector.

[Assistant] vec.push(10);


[User] Show me how to get dictionary keys in Python.

[Assistant] my_dict.keys()


[User] I want a SQL query that selects distinct values.

[Assistant] SELECT DISTINCT column_name FROM table_name;


[User] Show me how to reverse a string in Python using slicing.

[Assistant] s[::-1]


[User] I need a Java example for checking null values.

[Assistant]
if (obj == null) {
    // handle
}


[User] Show me how to join two lists in Python.

[Assistant] list1 + list2


[User] I want a Go example for creating a struct.

[Assistant]
type Person struct {
    Name string
}


[User] Show me how to check if a string starts with a prefix in Python.

[Assistant] s.startswith("abc")


[User] I want to check if a Python set contains a specific element.

[Assistant] element in my_set


[User] Show me how to create an empty list in Python.

[Assistant] my_list = []


[User] I need a JavaScript example for adding an item to an array.

[Assistant] arr.push(item);


[User] How can I find the minimum value in a JavaScript array?

[Assistant] Math.min(...arr)


[User] I want a Python example that checks if a number is greater than zero.

[Assistant] n > 0


[User] Show me how to convert an integer to a string in Python.

[Assistant] str(n)


[User] I need a Rust example for printing a variable to the console.

[Assistant] println!("{}", value);


[User] Show me how to remove an item from a Python set.

[Assistant] my_set.remove(value)


[User] I want a SQL query that selects rows where a column is not null.

[Assistant] SELECT * FROM table_name WHERE column_name IS NOT NULL;


[User] Show me how to find the length of a dictionary in Python.

[Assistant] len(my_dict)


[User] I need a Go example for creating an empty slice.

[Assistant] var arr []int


[User] Show me how to check if a string contains a substring in Python.

[Assistant] substring in s


[User] I want a Java example for converting a string to uppercase.

[Assistant] s.toUpperCase();


[User] Show me how to calculate the square root in Python.

[Assistant]
import math
math.sqrt(x)


[User] I need a JavaScript function that returns the square of a number.

[Assistant] const square = x => x * x;


[User] Show me how to iterate through a dictionary in Python.

[Assistant]
for k, v in my_dict.items():
    print(k, v)


[User] I want a C++ example for checking if a number is positive.

[Assistant]
if (n > 0) {
    cout << "positive";
}


[User] Show me how to convert a string to lowercase in JavaScript.

[Assistant] str.toLowerCase()


[User] I need a Python example that checks if a list is empty.

[Assistant] len(my_list) == 0


[User] Show me how to append multiple values to a list in Python.

[Assistant] my_list.extend([1,2,3])


[User] I want a Go example for checking if a slice contains an element.

[Assistant]
for _, v := range arr {
    if v == target {
        return true
    }
}


[User] Show me how to create a tuple in Python.

[Assistant] my_tuple = (1, 2, 3)


[User] I need a Java example for comparing two strings.

[Assistant] s1.equals(s2)


[User] Show me how to generate a random float in Python.

[Assistant]
import random
random.random()


[User] I want a Rust example for checking if an option is None.

[Assistant]
if option.is_none() {
    println!("None value");
}


[User] Show me how to replace a substring in Python.

[Assistant] s.replace("old", "new")


[User] I need a SQL query that updates a column value.

[Assistant] UPDATE table_name SET column_name = value WHERE condition;


[User] Show me how to check if a number is odd in Python.

[Assistant] n % 2 != 0


[User] I want a JavaScript example for reversing an array.

[Assistant] arr.reverse()


[User] Show me how to calculate exponentiation in Python.

[Assistant] pow(a, b)


[User] I need a Go example for formatting strings.

[Assistant] fmt.Sprintf("Hello %s", name)


[User] Show me how to create a dictionary with default values in Python.

[Assistant]
from collections import defaultdict
d = defaultdict(int)


[User] I want a C# example for checking if a list contains an item.

[Assistant] list.Contains(item)


[User] Show me how to remove duplicates from a list in Python.

[Assistant] list(set(my_list))


[User] I need a Java example for parsing integers.

[Assistant] int n = Integer.parseInt(str);


[User] Show me how to check if a string is numeric in Python.

[Assistant] s.isdigit()


[User] I want a Rust example for iterating over a vector.

[Assistant]
for v in vec {
    println!("{}", v);
}


[User] Show me how to join strings in JavaScript.

[Assistant] ["a","b"].join("")


[User] I need a SQL query that deletes a row by id.

[Assistant] DELETE FROM table_name WHERE id = 1;


[User] Show me how to check if a list contains duplicates in Python.

[Assistant] len(my_list) != len(set(my_list))


[User] I want a Go example for converting int to string.

[Assistant] strconv.Itoa(n)


[User] Show me how to split a string in Python.

[Assistant] s.split(" ")


[User] I need a JavaScript example for checking truthy values.

[Assistant]
if (value) {
    console.log("truthy");
}


[User] Show me how to calculate factorial recursively in Python.

[Assistant]
def factorial(n):
    if n == 0:
        return 1
    return n * factorial(n - 1)


[User] I want a C++ example for returning a boolean function.

[Assistant]
bool check(int n) {
    return n > 0;
}


[User] Show me how to access object properties in JavaScript.

[Assistant] obj.property


[User] I need a Python example for checking file existence.

[Assistant]
import os
os.path.exists("file.txt")


[User] Show me how to round a number in Python.

[Assistant] round(x)


[User] I want a Rust example for matching a number.

[Assistant]
match n {
    1 => println!("one"),
    _ => println!("other"),
}


[User] Show me how to convert a string to float in Python.

[Assistant] float(s)


[User] I need a Java example for trimming whitespace.

[Assistant] s.trim();