Dataset Viewer
Auto-converted to Parquet Duplicate
source
stringclasses
6 values
id
int64
0
111k
instruction
stringlengths
167
4.39k
response
stringlengths
244
6.1k
code_exercise_27k
0
Write a Python function named `add_numbers` that takes two parameters, `num1` and `num2`, and returns the sum of the two numbers. The function should handle both integer and floating-point inputs. The code should start with: ```python def add_numbers(num1: int | float, num2: int | float) -> int | float: ```
Here is the Python code to solve the given problem in the markdown block: ```python def add_numbers(num1: int | float, num2: int | float) -> int | float: """ This function takes two numbers as input and returns their sum. Parameters: num1 (int or float): The first number. num2 (int or float): The s...
code_exercise_27k
1
Write a Python function named `multiply_numbers` that takes two parameters, `num1` and `num2`, and returns the product of the two numbers. The function should handle both integer and floating-point inputs. The code should start with: ```python def multiply_numbers(num1: int | float, num2: int | float) -> int | float: `...
Here is the Python code to solve the given problem in the markdown block: ```python def multiply_numbers(num1: int | float, num2: int | float) -> int | float: """ Multiplies two numbers and returns the product. Args: num1 (int | float): The first number to be multiplied. num2 (int | float):...
code_exercise_27k
3
Write a Python function named `is_even` that takes a parameter `number` and returns `True` if the number is even, and `False` otherwise. The function should handle both positive and negative integers. The code should start with: ```python def is_even(number: int) -> bool: ```
Here is the Python code to solve the given problem in the markdown block: ```python def is_even(number: int) -> bool: """ Determines if a given number is even. Args: number (int): The number to check for evenness. Returns: bool: True if the number is even, False otherwise. """ ...
code_exercise_27k
4
Write a Python function named `is_prime` that takes a parameter `number` and returns `True` if the number is prime, and `False` otherwise. The function should be efficient and handle edge cases such as negative numbers, 0, and 1. The code should start with: ```python def is_prime(number: int) -> bool: ```
Here is the Python code to solve the given problem in the markdown block: ```python def is_prime(number: int) -> bool: """ Determines if a given number is prime. A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. Args: number (int): The num...
code_exercise_27k
5
Write a Python function named `reverse_string` that takes a parameter `string` and returns the reverse of the input string. The function should handle both empty strings and non-empty strings. The code should start with: ```python def reverse_string(string: str) -> str: ```
Here is the Python code to solve the given problem in the markdown block: ```python def reverse_string(string: str) -> str: """ Reverses the input string. Args: string (str): The input string to be reversed. Returns: str: The reversed string. If the input is None, returns an empty stri...
code_exercise_27k
7
Write a Python function named `find_max` that takes a parameter `numbers` which is a list of numbers, and returns the maximum number in the list. If the list is empty, the function should return `None`. The function should be efficient and handle various types of numeric inputs, including integers and floats. The code...
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List, Union def find_max(numbers: List[Union[int, float]]) -> Union[int, float, None]: """ Finds the maximum number in a list of numbers. Args: numbers (List[Union[int, float]]): A list of number...
code_exercise_27k
8
Write a Python function named `calculate_average` that takes a parameter `numbers` which is a list of numbers, and returns the average of the numbers in the list. If the list is empty, the function should return `None`. The function should handle lists of integers and floats. The code should start with: ```python from...
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List, Union, Optional def calculate_average(numbers: List[Union[int, float]]) -> Optional[float]: """ Calculate the average of a list of numbers. Args: numbers (List[Union[int, float]]): A list o...
code_exercise_27k
9
Write a Python function named `is_palindrome` that takes a parameter `string` and returns `True` if the string is a palindrome, and `False` otherwise. A palindrome is a word, phrase, number, or other sequence of characters that reads the same forward and backward, ignoring spaces, punctuation, and capitalization. The ...
Here is the Python code to solve the given problem in the markdown block: ```python def is_palindrome(string: str) -> bool: """ Determines if the given string is a palindrome. A palindrome is a word, phrase, number, or other sequence of characters that reads the same forward and backward, ignoring spac...
code_exercise_27k
10
Write a Python function named `remove_duplicates` that takes a parameter `numbers` which is a list of numbers, and returns a new list with duplicates removed, while preserving the original order of the elements. The function should handle an empty list and lists with both positive and negative numbers. The code should ...
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List def remove_duplicates(numbers: List[int]) -> List[int]: """ Removes duplicates from a list of numbers while preserving the original order of elements. Args: numbers (List[int]): A list of in...
code_exercise_27k
11
Write a Python function named `find_common_elements` that takes two parameters `list1` and `list2`, which are lists of numbers, and returns a new list containing the common elements between the two input lists. The common elements should not be repeated in the output list. The function should be efficient and avoid unn...
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List def find_common_elements(list1: List[int], list2: List[int]) -> List[int]: """ Finds and returns a list of common elements between two input lists of integers. Args: list1 (List[int]): The f...
code_exercise_27k
12
Write a Python function named `capitalize_words` that takes a parameter `sentence` which is a string, and returns a new string with the first letter of each word capitalized. The function should handle various edge cases, such as empty strings, strings with multiple spaces, and strings with punctuation. The code shoul...
Here is the Python code to solve the given problem in the markdown block: ```python def capitalize_words(sentence: str) -> str: """ Capitalizes the first letter of each word in the given sentence. Args: sentence (str): The input string to be processed. Returns: str: A new string with t...
code_exercise_27k
14
Write a Python function named `is_anagram` that takes two parameters `word1` and `word2`, which are strings, and returns `True` if the two words are anagrams, and `False` otherwise. An anagram is a word or phrase formed by rearranging the letters of another word or phrase. The function should ignore spaces and case dif...
Here is the Python code to solve the given problem in the markdown block: ```python def is_anagram(word1: str, word2: str) -> bool: """ Determines if two words are anagrams by comparing their character counts. Args: word1 (str): The first word. word2 (str): The second word. Returns: ...
code_exercise_27k
16
Write a Python function named `calculate_factorial` that takes a parameter `number` which is a non-negative integer, and returns the factorial of the input number. The factorial of a non-negative integer `n`, denoted by `n!`, is the product of all positive integers less than or equal to `n`. The function should handle ...
Here is the Python code to solve the given problem in the markdown block: ```python def calculate_factorial(number: int) -> int: """ Calculate the factorial of a given non-negative integer. The factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal ...
code_exercise_27k
17
Write a Python function named `add_numbers` that takes two parameters, `num1` and `num2`, and returns the sum of the two numbers. The function should handle both integer and floating-point inputs. The code should start with: ```python def add_numbers(num1: int | float, num2: int | float) -> int | float: ```
Here is the Python code to solve the given problem in the markdown block: ```python def add_numbers(num1: int | float, num2: int | float) -> int | float: """ This function takes two numbers as input and returns their sum. Parameters: num1 (int or float): The first number. num2 (int or float): The s...
code_exercise_27k
18
Write a Python function named `multiply_numbers` that takes two parameters, `num1` and `num2`, and returns the product of the two numbers. The function should handle both integer and floating-point inputs. The code should start with: ```python def multiply_numbers(num1: int | float, num2: int | float) -> int | float: `...
Here is the Python code to solve the given problem in the markdown block: ```python def multiply_numbers(num1: int | float, num2: int | float) -> int | float: """ Multiplies two numbers and returns the product. Args: num1 (int | float): The first number to be multiplied. num2 (int | float):...
code_exercise_27k
19
Write a Python function named `calculate_average` that takes a list of numbers as a parameter and returns the average of the numbers. The function should handle empty lists by returning `None` instead of raising an error. The code should start with: ```python from typing import List, Optional def calculate_average(num...
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List, Optional def calculate_average(numbers: List[float]) -> Optional[float]: """ Calculate the average of a list of numbers. If the list is empty, return None. Args: numbers (List[float]): A li...
code_exercise_27k
20
Write a Python function named `find_max` that takes a list of numbers as a parameter and returns the maximum number in the list. The function should handle an empty list by returning `None`. The code should start with: ```python from typing import List, Optional def find_max(numbers: List[int]) -> Optional[int]: ```
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List, Optional def find_max(numbers: List[int]) -> Optional[int]: """ Find the maximum number in a list of numbers. Args: numbers (List[int]): A list of integers. Returns: Optional[i...
code_exercise_27k
21
Write a Python function named `is_palindrome` that takes a string as a parameter and returns `True` if the string is a palindrome, and `False` otherwise. A palindrome is a word, phrase, number, or other sequence of characters that reads the same forward and backward, ignoring spaces, punctuation, and capitalization. T...
Here is the Python code to solve the given problem in the markdown block: ```python def is_palindrome(string: str) -> bool: """ Determines if the given string is a palindrome. A palindrome is a word, phrase, number, or other sequence of characters that reads the same forward and backward, ignoring spac...
code_exercise_27k
23
Write a Python function named `reverse_string` that takes a string as a parameter and returns the string in reverse order. The function should handle an empty string and should not use any built-in string reversal functions or methods. Instead, implement the reversal using a loop or recursion. The code should start wi...
Here is the Python code to solve the given problem in the markdown block: ```python def reverse_string(string: str) -> str: """ Reverses the input string without using built-in reversal functions or methods. Args: string (str): The input string to be reversed. Returns: str: The reverse...
code_exercise_27k
24
Write a Python function named `is_prime` that takes an integer as a parameter and returns `True` if the number is prime, and `False` otherwise. A prime number is a natural number greater than 1 that is not a product of two smaller natural numbers. The function should handle edge cases such as negative numbers, 0, and 1...
Here is the Python code to solve the given problem in the markdown block: ```python def is_prime(number: int) -> bool: """ Determines if a given integer is a prime number. A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. Parameters: number (i...
code_exercise_27k
25
Write a Python function named `calculate_factorial` that takes a non-negative integer as a parameter and returns its factorial. The factorial of a non-negative integer \( n \), denoted by \( n! \), is the product of all positive integers less than or equal to \( n \). The function should handle edge cases such as \( n ...
Here is the Python code to solve the given problem in the markdown block: ```python def calculate_factorial(n: int) -> int: """ Calculate the factorial of a non-negative integer n. The factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal to n. ...
code_exercise_27k
28
Write a Python function named `binary_search` that takes a sorted list and a target value as parameters, and returns the index of the target value in the list if it exists, or -1 if it does not exist. Implement the binary search algorithm to achieve this. The function should start with: ```python from typing import Lis...
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List def binary_search(lst: List[int], target: int) -> int: """ Perform a binary search on a sorted list to find the index of a target value. Args: lst (List[int]): The sorted list in which to se...
code_exercise_27k
29
Write a Python function named `capitalize_words` that takes a string as a parameter and returns a new string with the first letter of each word capitalized. The function should handle various edge cases, such as empty strings, strings with multiple spaces, and strings with punctuation. The code should start with: ```p...
Here is the Python code to solve the given problem in the markdown block: ```python def capitalize_words(string: str) -> str: """ Capitalizes the first letter of each word in the given string. Args: string (str): The input string to be processed. Returns: str: A new string with the fir...
code_exercise_27k
33
Write a Python function named `is_anagram` that takes two strings as parameters and returns `True` if the two strings are anagrams, and `False` otherwise. An anagram is a word or phrase formed by rearranging the letters of another word or phrase. The function should ignore spaces and be case-insensitive. The code shou...
Here is the Python code to solve the given problem in the markdown block: ```python def is_anagram(string1: str, string2: str) -> bool: """ Determines if two strings are anagrams of each other. An anagram is a word or phrase formed by rearranging the letters of another word or phrase. This function ign...
code_exercise_27k
37
Write a Python function named `calculate_area_rectangle` that takes the length and width of a rectangle as input and returns its area. The function should handle both integer and floating-point inputs. The code should start with: ```python def calculate_area_rectangle(length: float, width: float) -> float: ```
Here is the Python code to solve the given problem in the markdown block: ```python def calculate_area_rectangle(length: float, width: float) -> float: """ Calculate the area of a rectangle given its length and width. Args: length (float): The length of the rectangle. width (float): The wid...
code_exercise_27k
38
Write a Python function named `calculate_circumference_circle` that takes the radius of a circle as input and returns its circumference. The function should handle both integer and floating-point inputs for the radius. The code should start with: ```python import math def calculate_circumference_circle(radius: float) ...
Here is the Python code to solve the given problem in the markdown block: ```python import math def calculate_circumference_circle(radius: float) -> float: """ Calculate the circumference of a circle given its radius. Args: radius (float): The radius of the circle. Returns: float: The...
code_exercise_27k
40
Write a Python function named `calculate_factorial` that takes a non-negative integer as input and returns its factorial. The function should handle edge cases such as zero and large numbers efficiently. The code should start with: ```python def calculate_factorial(number: int) -> int: ```
Here is the Python code to solve the given problem in the markdown block: ```python def calculate_factorial(number: int) -> int: """ Calculate the factorial of a given non-negative integer. The factorial of a non-negative integer n is the product of all positive integers less than or equal to n. The fa...
code_exercise_27k
44
Write a Python function named `check_prime` that takes an integer as input and returns `True` if the number is prime, and `False` otherwise. The function should handle edge cases such as negative numbers, zero, and one, which are not prime numbers. The function should also be efficient by checking divisibility only up ...
Here is the Python code to solve the given problem in the markdown block: ```python def check_prime(number: int) -> bool: """ Check if the given number is a prime number. Args: number (int): The number to be checked for primality. Returns: bool: True if the number is prime, False other...
code_exercise_27k
45
Write a Python function named `calculate_gcd` that takes two integers as input and returns their greatest common divisor (GCD) using the Euclidean algorithm. The function should handle both positive and negative integers. The code should start with: ```python def calculate_gcd(num1: int, num2: int) -> int: ```
Here is the Python code to solve the given problem in the markdown block: ```python def calculate_gcd(num1: int, num2: int) -> int: """ Calculate the greatest common divisor (GCD) of two integers using the Euclidean algorithm. Args: num1 (int): The first integer. num2 (int): The second inte...
code_exercise_27k
47
Write a Python function to calculate the product of two numbers, `num1` and `num2`, and return the result. The function should handle both integer and floating-point inputs. The code should start with: ```python def multiply_numbers(num1: int | float, num2: int | float) -> int | float: ```
Here is the Python code to solve the given problem in the markdown block: ```python def multiply_numbers(num1: int | float, num2: int | float) -> int | float: """ Calculate the product of two numbers. Args: num1 (int | float): The first number. num2 (int | float): The second number. Re...
code_exercise_27k
48
Write a Python function named `is_odd` that takes a parameter `num` and returns `True` if the number is odd, and `False` otherwise. The function should be efficient and straightforward. The code should start with: ```python def is_odd(num: int) -> bool: ```
Here is the Python code to solve the given problem in the markdown block: ```python def is_odd(num: int) -> bool: """ Determines if a given number is odd. Args: num (int): The number to be checked. Returns: bool: True if the number is odd, False otherwise. """ # Check if the nu...
code_exercise_27k
49
Write a Python function named `is_prime` that takes a parameter `num` and returns `True` if the number is prime, and `False` otherwise. The function should be efficient and handle edge cases such as negative numbers, 0, and 1. The code should start with: ```python def is_prime(num: int) -> bool: ```
Here is the Python code to solve the given problem in the markdown block: ```python def is_prime(num: int) -> bool: """ Determines if a given number is prime. Args: num (int): The number to be checked for primality. Returns: bool: True if the number is prime, False otherwise. """ ...
code_exercise_27k
50
Write a Python function named `reverse_string` that takes a parameter `string` and returns the reverse of the input string. The function should handle an empty string and should not use any built-in string reversal functions or methods. Instead, implement the reversal using a loop or recursion. The code should start w...
Here is the Python code to solve the given problem in the markdown block: ```python def reverse_string(string: str) -> str: """ Reverses the input string without using built-in reversal functions or methods. Args: string (str): The input string to be reversed. Returns: str: The reverse...
code_exercise_27k
53
Write a Python function named `find_max_with_index` that takes a parameter `numbers`, which is a list of numbers, and returns a tuple containing the maximum number in the list and its index. If the list is empty, the function should return `None`. The code should start with: ```python from typing import List, Tuple, O...
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List, Tuple, Optional def find_max_with_index(numbers: List[int]) -> Optional[Tuple[int, int]]: """ Finds the maximum number in the list and returns it along with its index. Args: numbers (List[i...
code_exercise_27k
54
Write a Python function named `remove_duplicates` that takes a parameter `numbers`, which is a list of numbers, and returns a new list with duplicates removed while maintaining the original order of elements. The function should use a set to track seen elements and a list to store the result. The code should start with...
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List def remove_duplicates(numbers: List[int]) -> List[int]: """ Removes duplicates from a list of numbers while maintaining the original order of elements. Args: numbers (List[int]): A list of n...
code_exercise_27k
56
Write a Python function named `capitalize_words` that takes a parameter `string`, which is a sentence, and returns a new sentence with the first letter of each word capitalized. The function should handle various edge cases, such as empty strings, strings with multiple spaces, and strings with punctuation. The code sh...
Here is the Python code to solve the given problem in the markdown block: ```python def capitalize_words(string: str) -> str: """ Capitalizes the first letter of each word in the given sentence. Args: string (str): The input sentence. Returns: str: The new sentence with the first lette...
code_exercise_27k
57
Write a Python function named `find_common_elements` that takes two parameters, `list1` and `list2`, which are lists of numbers, and returns a new list containing the common elements between the two lists. The function should ensure that the common elements are unique and appear only once in the returned list, regardle...
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List def find_common_elements(list1: List[int], list2: List[int]) -> List[int]: """ Finds the common elements between two lists of numbers and returns a new list containing these elements. The returned li...
code_exercise_27k
58
Write a Python function to calculate the factorial of a given non-negative integer using an iterative approach. The function should handle edge cases such as zero and large numbers efficiently. The code should start with: ```python def calculate_factorial(num: int) -> int: ```
Here is the Python code to solve the given problem in the markdown block: ```python def calculate_factorial(num: int) -> int: """ Calculate the factorial of a given non-negative integer using an iterative approach. Args: num (int): The non-negative integer for which to calculate the factorial. ...
code_exercise_27k
59
Write a Python function named `find_median` that takes a parameter `numbers`, which is a list of numbers, and returns the median of the numbers. The median is defined as the middle value in a sorted list of numbers. If the list has an even number of elements, the median is the average of the two middle numbers. The fun...
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List def find_median(numbers: List[int]) -> float: """ Calculate the median of a list of numbers. The median is the middle value in a sorted list of numbers. If the list has an even number of elements, ...
code_exercise_27k
60
Write a Python function named `is_anagram` that takes two parameters, `word1` and `word2`, which are strings, and returns `True` if the two words are anagrams (contain the same letters in a different order), and `False` otherwise. The function should be case-insensitive and should ignore spaces. The code should start ...
Here is the Python code to solve the given problem in the markdown block: ```python def is_anagram(word1: str, word2: str) -> bool: """ Determines if two words are anagrams by comparing their sorted characters. Args: word1 (str): The first word to compare. word2 (str): The second word to co...
code_exercise_27k
62
Write a Python function named `remove_whitespace` that takes a parameter `string`, which is a sentence, and returns a new sentence with all whitespace characters removed. The function should handle various types of whitespace characters, including spaces, tabs, and newlines. The code should start with: ```python def re...
Here is the Python code to solve the given problem in the markdown block: ```python def remove_whitespace(string: str) -> str: """ Removes all whitespace characters from the given sentence. Parameters: string (str): The input sentence from which whitespace characters are to be removed. Returns: ...
code_exercise_27k
64
Write a Python function named `is_power_of_two` that takes a parameter `num`, which is a positive integer, and returns `True` if the number is a power of two, and `False` otherwise. The function should use bitwise operations to determine if the number is a power of two. The code should start with: ```python def is_pow...
Here is the Python code to solve the given problem in the markdown block: ```python def is_power_of_two(num: int) -> bool: """ Determines if a given positive integer is a power of two using bitwise operations. Args: num (int): The positive integer to check. Returns: bool: True if the n...
code_exercise_27k
66
Write a Python function named `is_pangram` that takes a parameter `sentence`, which is a string, and returns `True` if the sentence is a pangram (contains all the letters of the English alphabet), and `False` otherwise. The function should be case-insensitive and should ignore non-alphabetic characters. The code shoul...
Here is the Python code to solve the given problem in the markdown block: ```python def is_pangram(sentence: str) -> bool: """ Determines if the given sentence is a pangram (contains all the letters of the English alphabet). Args: sentence (str): The input sentence to check. Returns: b...
code_exercise_27k
67
Write a Python function named `find_nth_largest` that takes two parameters, `numbers` and `n`, where `numbers` is a list of numbers and `n` is a positive integer, and returns the nth largest number in the list. If `n` is greater than the length of the list, the function should return `None`. The code should start with...
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List, Union def find_nth_largest(numbers: List[Union[int, float]], n: int) -> Union[int, float, None]: """ Finds the nth largest number in a given list of numbers. Args: numbers (List[Union[int, ...
code_exercise_27k
68
Write a Python function named `is_armstrong_number` that takes a parameter `num`, which is a positive integer, and returns `True` if the number is an Armstrong number, and `False` otherwise. An Armstrong number is a number that is equal to the sum of its own digits raised to the power of the number of digits. The code...
Here is the Python code to solve the given problem in the markdown block: ```python def is_armstrong_number(num: int) -> bool: """ Determines if a given positive integer is an Armstrong number. An Armstrong number is a number that is equal to the sum of its own digits raised to the power of the number ...
code_exercise_27k
70
Write a Python function named `is_perfect_square` that takes a parameter `num`, which is a positive integer, and returns `True` if the number is a perfect square, and `False` otherwise. The function should use an efficient method to determine if the number is a perfect square without using floating-point arithmetic. T...
Here is the Python code to solve the given problem in the markdown block: ```python def is_perfect_square(num: int) -> bool: """ Determines if a given positive integer is a perfect square. This function uses a binary search method to find the integer square root of the number, ensuring that no floating...
code_exercise_27k
73
Write a Python function named `find_missing_number` that takes a parameter `numbers`, which is a list of numbers from 1 to n (inclusive) with one number missing, and returns the missing number. The function should be efficient and handle lists of varying lengths. The code should start with: ```python from typing impor...
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List def find_missing_number(numbers: List[int]) -> int: """ Finds the missing number in a list of numbers from 1 to n (inclusive) with one number missing. Args: numbers (List[int]): A list of nu...
code_exercise_27k
74
Write a Python function named `find_mode` that takes a parameter `numbers`, which is a list of numbers, and returns a list of the most frequently occurring numbers in the list. If there are multiple numbers with the same highest frequency, return all of them in ascending order. The code should start with: ```python fr...
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List def find_mode(numbers: List[int]) -> List[int]: """ Find the most frequently occurring numbers in a list and return them in ascending order. Args: numbers (List[int]): A list of numbers. ...
code_exercise_27k
77
Write a Python function named `find_unique_characters` that takes a parameter `string`, which is a sentence, and returns a new string containing only the unique characters from the sentence, in the order they appear. The function should handle any input string, including empty strings and strings with special character...
Here is the Python code to solve the given problem in the markdown block: ```python def find_unique_characters(string: str) -> str: """ Returns a new string containing only the unique characters from the input sentence, in the order they appear. Args: string (str): The input sentence from which to ...
code_exercise_27k
78
Write a Python function named `find_lcm` that takes two parameters, `num1` and `num2`, which are positive integers, and returns the least common multiple (LCM) of the two numbers. The function should use the Euclidean algorithm to find the greatest common divisor (GCD) and then calculate the LCM using the relationship ...
Here is the Python code to solve the given problem in the markdown block: ```python def find_lcm(num1: int, num2: int) -> int: """ Calculate the least common multiple (LCM) of two positive integers. This function uses the Euclidean algorithm to find the greatest common divisor (GCD) and then calculates...
code_exercise_27k
79
Write a Python function named `find_nth_fibonacci` that takes a parameter `n`, which is a positive integer, and returns the nth Fibonacci number. The function should handle edge cases such as when `n` is 1 or 2, and should return `None` for any non-positive integer input. The function should use an iterative approach t...
Here is the Python code to solve the given problem in the markdown block: ```python def find_nth_fibonacci(n: int) -> int: """ Calculate the nth Fibonacci number using an iterative approach. Args: n (int): The position of the Fibonacci number to find. Returns: int: The nth Fibonacci nu...
code_exercise_27k
81
Write a Python function named `find_smallest_missing_positive` that takes a parameter `numbers`, which is a list of integers, and returns the smallest missing positive integer that is not present in the list. The function should handle lists containing both positive and negative integers, as well as zero. The code shou...
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List def find_smallest_missing_positive(numbers: List[int]) -> int: """ Find the smallest missing positive integer in a list of integers. Args: numbers (List[int]): A list of integers. Retur...
code_exercise_27k
84
Write a Python function named `find_sum_of_digits` that takes a parameter `num`, which is a positive integer, and returns the sum of its digits. The function should handle the input validation to ensure that the input is a positive integer. If the input is not a positive integer, the function should return `-1`. The c...
Here is the Python code to solve the given problem in the markdown block: ```python def find_sum_of_digits(num: int) -> int: """ Calculate the sum of the digits of a given positive integer. Args: num (int): The positive integer whose digits are to be summed. Returns: int: The sum of th...
code_exercise_27k
86
Write a Python function named `find_second_largest_unique` that takes a parameter `numbers`, which is a list of numbers, and returns the second largest unique number in the list. If there is no second largest unique number, return `None`. The code should start with: ```python from typing import List, Union def find_s...
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List, Union def find_second_largest_unique(numbers: List[Union[int, float]]) -> Union[int, float, None]: """ Finds the second largest unique number in a list of numbers. Args: numbers (List[Union...
code_exercise_27k
87
Write a Python function named `count_occurrences` that takes two parameters, `numbers` and `target`, where `numbers` is a list of numbers and `target` is a number, and returns the number of occurrences of the target number in the list. The function should be efficient and handle various edge cases, such as an empty lis...
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List, Union def count_occurrences(numbers: List[Union[int, float]], target: Union[int, float]) -> int: """ Counts the number of occurrences of a target number in a list of numbers. Args: numbers ...
code_exercise_27k
88
Write a Python function named `find_smallest_common_multiple` that takes two parameters, `num1` and `num2`, which are positive integers, and returns the smallest common multiple (LCM) of the two numbers. The function should use the greatest common divisor (GCD) to calculate the LCM. The code should start with: ```pyth...
Here is the Python code to solve the given problem in the markdown block: ```python def find_smallest_common_multiple(num1: int, num2: int) -> int: """ Calculate the smallest common multiple (LCM) of two positive integers. Args: num1 (int): The first positive integer. num2 (int): The second...
code_exercise_27k
89
Write a Python function named `find_missing_elements` that takes two parameters, `numbers` and `n`, where `numbers` is a list of numbers from 1 to `n` (inclusive) with some numbers missing, and `n` is a positive integer. The function should return a new list containing the missing numbers. The code should start with: ...
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List def find_missing_elements(numbers: List[int], n: int) -> List[int]: """ Finds the missing numbers in a list of numbers from 1 to n (inclusive). Args: numbers (List[int]): A list of numbers f...
code_exercise_27k
90
Write a Python function named `find_median_sorted` that takes a parameter `numbers`, which is a sorted list of numbers, and returns the median of the numbers. The function should handle both even and odd lengths of the list and return the median accordingly. The code should start with: ```python from typing import List...
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List def find_median_sorted(numbers: List[int]) -> float: """ Calculate the median of a sorted list of numbers. Args: numbers (List[int]): A sorted list of numbers. Returns: float: T...
code_exercise_27k
92
Write a Python function to find all prime numbers up to a given positive integer `n` using the Sieve of Eratosthenes algorithm. The function should return a list of prime numbers. The code should start with: ```python from typing import List def find_prime_numbers(n: int) -> List[int]: ```
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List def find_prime_numbers(n: int) -> List[int]: """ Find all prime numbers up to a given positive integer n using the Sieve of Eratosthenes algorithm. Args: n (int): The positive integer up to ...
code_exercise_27k
93
Write a Python function named `find_unique_elements` that takes a parameter `numbers`, which is a list of numbers, and returns a new list containing only the unique elements from the original list, in the order they appear. The function should maintain the order of the first occurrence of each element. The code should...
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List def find_unique_elements(numbers: List[int]) -> List[int]: """ Returns a new list containing only the unique elements from the original list, in the order they appear. Args: numbers (List[in...
code_exercise_27k
94
Write a Python function named `find_nth_largest_unique` that takes two parameters, `numbers` and `n`, where `numbers` is a list of numbers and `n` is a positive integer, and returns the nth largest unique number in the list. If there is no nth largest unique number, return `None`. The function should start with: ```py...
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List, Union def find_nth_largest_unique(numbers: List[Union[int, float]], n: int) -> Union[int, float, None]: """ Finds the nth largest unique number in a list of numbers. Args: numbers (List[Uni...
code_exercise_27k
96
Write a Python function named `find_sum_of_even_numbers` that takes a parameter `numbers`, which is a list of integers, and returns the sum of the even numbers in the list. If the list is empty or contains no even numbers, the function should return 0. The function should handle both positive and negative integers. Th...
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List def find_sum_of_even_numbers(numbers: List[int]) -> int: """ Calculate the sum of all even numbers in the given list. Args: numbers (List[int]): A list of integers. Returns: int...
code_exercise_27k
97
Write a Python function named `count_words` that takes a parameter `sentence`, which is a string representing a sentence, and returns the number of words in the sentence. The function should handle various edge cases, such as sentences with multiple spaces, leading/trailing spaces, and empty sentences. The code should...
Here is the Python code to solve the given problem in the markdown block: ```python def count_words(sentence: str) -> int: """ Counts the number of words in a given sentence. Args: sentence (str): The input sentence to count the words from. Returns: int: The number of words in the sent...
code_exercise_27k
98
Write a Python function named `find_sum_of_odd_numbers` that takes a parameter `numbers`, which is a list of integers, and returns the sum of the odd numbers in the list. The function should handle an empty list by returning 0. The code should start with: ```python from typing import List def find_sum_of_odd_numbers(n...
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List def find_sum_of_odd_numbers(numbers: List[int]) -> int: """ Calculate the sum of all odd numbers in the given list. Args: numbers (List[int]): A list of integers. Returns: int: ...
code_exercise_27k
100
Write a Python function named `calculate_average` that takes a parameter `numbers`, which is a list of numbers, and returns the average of the numbers. If the list is empty, the function should return 0. The function should handle both integer and floating-point numbers. The code should start with: ```python from typi...
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List def calculate_average(numbers: List[float]) -> float: """ Calculate the average of a list of numbers. Args: numbers (List[float]): A list of numbers (integers or floating-point numbers). ...
code_exercise_27k
106
Write a Python function named `find_number_of_words_with_prefix` that takes two parameters, `sentence` and `prefix`, where `sentence` is a string containing multiple words separated by spaces, and `prefix` is a string. The function should return the number of words in the `sentence` that start with the specified `prefi...
Here is the Python code to solve the given problem in the markdown block: ```python def find_number_of_words_with_prefix(sentence: str, prefix: str) -> int: """ Counts the number of words in a given sentence that start with the specified prefix. Args: sentence (str): The input sentence containing m...
code_exercise_27k
109
Write a Python function named `find_number_of_words_with_character` that takes two parameters, `string` and `character`, where `string` is a sentence and `character` is a single character. The function should return the number of words in the sentence that contain the specified character. The function should handle cas...
Here is the Python code to solve the given problem in the markdown block: ```python def find_number_of_words_with_character(string: str, character: str) -> int: """ Returns the number of words in the given sentence that contain the specified character. Args: string (str): The input sentence. ...
code_exercise_27k
111
Write a Python function named `find_number_of_words_with_multiple_substrings` that takes two parameters, `string` and `substrings`, where `string` is a sentence and `substrings` is a list of strings. The function should return the number of words in the sentence that contain any of the specified substrings. The code s...
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List def find_number_of_words_with_multiple_substrings(string: str, substrings: List[str]) -> int: """ This function takes a sentence and a list of strings as input and returns the number of words in the sent...
code_exercise_27k
114
Write a Python function to calculate the sum of two numbers, supporting both integers and floating-point numbers. The function should be able to handle edge cases such as negative numbers, zero, and very large numbers. The code should start with: ```python def add_numbers(num1: int | float, num2: int | float) -> int | ...
Here is the Python code to solve the given problem in the markdown block: ```python def add_numbers(num1: int | float, num2: int | float) -> int | float: """ Calculate the sum of two numbers. This function takes two numbers, which can be either integers or floating-point numbers, and returns their sum....
code_exercise_27k
116
Write a Python function to find the maximum number in a given list of numbers without using the built-in `max()` function. The function should iterate through the list and keep track of the maximum value encountered. The code should start with: ```python from typing import List, Union def find_max_without_builtin(numb...
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List, Union def find_max_without_builtin(numbers: List[Union[int, float]]) -> Union[int, float]: """ Find the maximum number in a given list of numbers without using the built-in max() function. Args: ...
code_exercise_27k
118
Write a Python function to count the number of vowels in a given string, ignoring case sensitivity. The function should return the count of vowels (a, e, i, o, u) in the string. The code should start with: ```python def count_vowels(string: str) -> int: ```
Here is the Python code to solve the given problem in the markdown block: ```python def count_vowels(string: str) -> int: """ Counts the number of vowels (a, e, i, o, u) in a given string, ignoring case sensitivity. Args: string (str): The input string to count vowels in. Returns: int:...
code_exercise_27k
119
Write a Python function to reverse a given list without modifying the original list. The function should return a new list with the elements in reverse order. The code should start with: ```python from typing import List def reverse_list(lst: List) -> List: ```
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List def reverse_list(lst: List) -> List: """ Reverses a given list without modifying the original list and returns a new list with the elements in reverse order. Args: lst (List): The input list...
code_exercise_27k
120
Write a Python function to determine if a given number is a prime number. The function should return `True` if the number is prime and `False` otherwise. A prime number is defined as a natural number greater than 1 that has no positive divisors other than 1 and itself. The code should start with: ```python import math...
Here is the Python code to solve the given problem in the markdown block: ```python import math def is_prime(number: int) -> bool: """ Determines if a given number is a prime number. Args: number (int): The number to check for primality. Returns: bool: True if the number is prime, Fal...
code_exercise_27k
121
Write a Python function called `find_duplicates` that takes a list as a parameter and returns a new list containing only the elements that appear more than once in the original list. The function should be efficient and avoid using the `count` method within a loop to prevent performance issues with large lists. The co...
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List def find_duplicates(lst: List) -> List: """ Finds and returns a list of elements that appear more than once in the input list. Args: lst (List): The input list from which to find duplicate e...
code_exercise_27k
124
Write a Python function called `capitalize_names` that takes a list of names as a parameter and returns a new list with each name capitalized (first letter uppercase, rest lowercase). The function should handle various edge cases, such as empty strings, names with leading or trailing spaces, and names with mixed case. ...
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List def capitalize_names(names: List[str]) -> List[str]: """ Capitalizes each name in the input list, ensuring the first letter is uppercase and the rest are lowercase. Args: names (List[str]): ...
code_exercise_27k
125
Write a Python function to calculate the factorial of a given non-negative integer using an iterative approach. The factorial of a non-negative integer \( n \), denoted by \( n! \), is the product of all positive integers less than or equal to \( n \). The function should handle edge cases such as \( n = 0 \) and \( n ...
Here is the Python code to solve the given problem in the markdown block: ```python def calculate_factorial(number: int) -> int: """ Calculate the factorial of a given non-negative integer. The factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal ...
code_exercise_27k
126
Write a Python function to reverse a given string. The function should take a string as input and return a new string with the characters in reverse order. The function should handle empty strings and strings with special characters and spaces correctly. The code should start with: ```python def reverse_string(string:...
Here is the Python code to solve the given problem in the markdown block: ```python def reverse_string(string: str) -> str: """ Reverses the input string and returns the reversed string. Args: string (str): The input string to be reversed. Returns: str: The reversed string. If the inpu...
code_exercise_27k
127
Write a Python function to determine if two given strings are anagrams of each other. An anagram is a word or phrase formed by rearranging the letters of another word or phrase, using all the original letters exactly once. The function should ignore case and any non-alphabetic characters. The code should start with: `...
Here is the Python code to solve the given problem in the markdown block: ```python def is_anagram(string1: str, string2: str) -> bool: """ Determines if two given strings are anagrams of each other. Args: string1 (str): The first input string. string2 (str): The second input string. R...
code_exercise_27k
128
Write a Python function to find the missing number in a list of numbers from 1 to n (inclusive) where one number is missing. The function should return the missing number. The code should start with: ```python from typing import List def find_missing_number(numbers: List[int]) -> int: ```
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List def find_missing_number(numbers: List[int]) -> int: """ Finds the missing number in a list of numbers from 1 to n (inclusive) where one number is missing. Args: numbers (List[int]): The list...
code_exercise_27k
129
Write a Python function to determine if a given string is a pangram. A pangram is a sentence that contains every letter of the alphabet at least once. The function should return `True` if the string is a pangram and `False` otherwise. The function should be case-insensitive and should ignore non-alphabetic characters. ...
Here is the Python code to solve the given problem in the markdown block: ```python def is_pangram(string: str) -> bool: """ Determine if the given string is a pangram. A pangram is a sentence that contains every letter of the alphabet at least once. This function is case-insensitive and ignores non-al...
code_exercise_27k
131
Write a Python function called `remove_whitespace` that takes a string as a parameter and returns a new string with all whitespace characters removed. The function should handle various types of whitespace characters, including spaces, tabs, newlines, and carriage returns. The code should start with: ```python def remo...
Here is the Python code to solve the given problem in the markdown block: ```python import re def remove_whitespace(string: str) -> str: """ Removes all whitespace characters from the given string. Parameters: string (str): The input string from which whitespace characters are to be removed. Retu...
code_exercise_27k
132
Write a Python function to determine if a given number is a power of two. A number is considered a power of two if it can be expressed as \(2^n\) where \(n\) is a non-negative integer. The function should return `True` if the number is a power of two, and `False` otherwise. The function should handle edge cases such as...
Here is the Python code to solve the given problem in the markdown block: ```python def is_power_of_two(number: int) -> bool: """ Determines if a given number is a power of two. A number is considered a power of two if it can be expressed as 2^n where n is a non-negative integer. Args: number ...
code_exercise_27k
135
Write a Python function named `calculate_average` that takes a list of numbers as input and returns the average of those numbers. The function should handle the case where the input list is empty by returning 0. The code should start with: ```python from typing import List def calculate_average(numbers: List[float]) -...
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List def calculate_average(numbers: List[float]) -> float: """ Calculate the average of a list of numbers. Args: numbers (List[float]): A list of numbers for which the average is to be calculated...
code_exercise_27k
136
Write a Python function named `calculate_factorial` that takes a positive integer as input and returns its factorial. The function should handle edge cases such as input being 0 or 1, and should raise a `ValueError` if the input is a negative integer. The code should start with: ```python def calculate_factorial(n: int...
Here is the Python code to solve the given problem in the markdown block: ```python def calculate_factorial(n: int) -> int: """ Calculate the factorial of a given positive integer. Parameters: n (int): A positive integer. Returns: int: The factorial of the input number. Raises: ValueE...
code_exercise_27k
138
Write a Python function named `calculate_power` that takes two numbers as input: `base` and `exponent`. The function should return the result of raising the `base` to the power of the `exponent`. The function should handle both integer and floating-point inputs. The code should start with: ```python def calculate_power...
Here is the Python code to solve the given problem in the markdown block: ```python def calculate_power(base: float, exponent: float) -> float: """ Calculate the result of raising the base to the power of the exponent. Args: base (float): The base number. exponent (float): The exponent. ...
code_exercise_27k
139
Write a Python function to calculate the length of the hypotenuse of a right triangle given the lengths of its two legs. The function should be named `calculate_hypotenuse` and should take two parameters representing the lengths of the legs. The function should return the length of the hypotenuse as a float. The code ...
Here is the Python code to solve the given problem in the markdown block: ```python import math def calculate_hypotenuse(side1: float, side2: float) -> float: """ Calculate the length of the hypotenuse of a right triangle given the lengths of its two legs. Args: side1 (float): The length of the fi...
code_exercise_27k
140
Write a Python function named `calculate_area_rectangle` that takes the length and width of a rectangle as input and returns its area. The function should handle both integer and floating-point inputs. The code should start with: ```python def calculate_area_rectangle(length: float, width: float) -> float: ```
Here is the Python code to solve the given problem in the markdown block: ```python def calculate_area_rectangle(length: float, width: float) -> float: """ Calculate the area of a rectangle given its length and width. Args: length (float): The length of the rectangle. width (float): The wid...
code_exercise_27k
142
Write a Python function named `check_prime` that takes a positive integer as input and returns `True` if it is a prime number, and `False` otherwise. The function should be efficient and handle edge cases such as numbers less than or equal to 1. The code should start with: ```python def check_prime(n: int) -> bool: ``...
Here is the Python code to solve the given problem in the markdown block: ```python def check_prime(n: int) -> bool: """ Determines if a given positive integer is a prime number. Args: n (int): A positive integer to check for primality. Returns: bool: True if the number is prime, False...
code_exercise_27k
144
Write a Python function named `calculate_gcd` that takes two positive integers as input and returns their greatest common divisor (GCD) using the Euclidean algorithm. The function should handle the case where one or both of the inputs are zero by returning 0, as the GCD of zero with any number is zero. The code should...
Here is the Python code to solve the given problem in the markdown block: ```python def calculate_gcd(a: int, b: int) -> int: """ Calculate the greatest common divisor (GCD) of two positive integers using the Euclidean algorithm. Args: a (int): The first positive integer. b (int): The secon...
code_exercise_27k
145
Write a Python function named `calculate_lcm` that takes two positive integers as input and returns their least common multiple (LCM). The function should use the greatest common divisor (GCD) to compute the LCM efficiently. The code should start with: ```python def calculate_lcm(a: int, b: int) -> int: ```
Here is the Python code to solve the given problem in the markdown block: ```python def calculate_gcd(a: int, b: int) -> int: """ Calculate the greatest common divisor (GCD) of two positive integers using the Euclidean algorithm. Args: a (int): The first positive integer. b (int): The secon...
code_exercise_27k
146
Write a Python function named `calculate_square_root` that takes a positive number as input and returns its square root. The function should handle the input validation to ensure that the input is a positive number. If the input is not a positive number, the function should raise a `ValueError`. The code should start ...
Here is the Python code to solve the given problem in the markdown block: ```python import math def calculate_square_root(n: float) -> float: """ Calculate the square root of a positive number. Args: n (float): A positive number for which the square root is to be calculated. Returns: ...
code_exercise_27k
147
Write a Python function named `calculate_area_circle` that takes the radius of a circle as input and returns its area. The function should handle both integer and floating-point inputs for the radius. The code should start with: ```python import math def calculate_area_circle(radius: float) -> float: ```
Here is the Python code to solve the given problem in the markdown block: ```python import math def calculate_area_circle(radius: float) -> float: """ Calculate the area of a circle given its radius. Args: radius (float): The radius of the circle. Must be a non-negative number. Returns: ...
code_exercise_27k
148
Write a Python function named `calculate_area_circle` that takes the radius of a circle as input and returns its area. The function should be able to handle both integer and floating-point inputs for the radius. The code should start with: ```python import math def calculate_area_circle(radius: float) -> float: ```
Here is the Python code to solve the given problem in the markdown block: ```python import math def calculate_area_circle(radius: float) -> float: """ Calculate the area of a circle given its radius. Args: radius (float): The radius of the circle. If negative, it is treated as zero. Returns: ...
code_exercise_27k
151
Write a Python function named `calculate_sum` that takes a list of numbers as input and returns the sum of those numbers. The function should handle both integers and floating-point numbers. The code should start with: ```python from typing import List, Union def calculate_sum(numbers: List[Union[int, float]]) -> Unio...
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List, Union def calculate_sum(numbers: List[Union[int, float]]) -> Union[int, float]: """ Calculate the sum of a list of numbers. Args: numbers (List[Union[int, float]]): A list of numbers (integ...
code_exercise_27k
152
Write a Python function named `calculate_product` that takes a list of numbers as input and returns the product of those numbers. The function should handle an empty list by returning 1, as the product of no numbers is defined as 1. The function should also handle lists containing zero, which will result in a product o...
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List def calculate_product(numbers: List[int]) -> int: """ Calculate the product of all numbers in the given list. Args: numbers (List[int]): A list of integers. Returns: int: The pr...
code_exercise_27k
160
Write a Python function named `reverse_string` that takes a string as input and returns the reverse of that string. The function should handle empty strings and strings with special characters and spaces correctly. The code should start with: ```python def reverse_string(string: str) -> str: ```
Here is the Python code to solve the given problem in the markdown block: ```python def reverse_string(string: str) -> str: """ Reverses the input string. Args: string (str): The input string to be reversed. Returns: str: The reversed string. """ # Ensure the input is a string ...
code_exercise_27k
164
Write a Python function named `find_max_number` that takes a list of numbers as input and returns the maximum number. The function should handle an empty list by returning `None`. The code should start with: ```python from typing import List, Optional def find_max_number(numbers: List[int]) -> Optional[int]: ```
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List, Optional def find_max_number(numbers: List[int]) -> Optional[int]: """ Find the maximum number in a list of numbers. Args: numbers (List[int]): A list of integers. Returns: Opt...
code_exercise_27k
165
Write a Python function named `find_min_number` that takes a list of numbers as input and returns the minimum number. The function should handle an empty list by returning `None`. The code should start with: ```python from typing import List, Optional def find_min_number(numbers: List[int]) -> Optional[int]: ```
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List, Optional def find_min_number(numbers: List[int]) -> Optional[int]: """ Find the minimum number in a list of numbers. Args: numbers (List[int]): A list of integers from which to find the min...
code_exercise_27k
167
Write a Python function named `calculate_factorial_iterative` that takes a positive integer as input and returns its factorial using iteration. The function should handle edge cases such as input being 0 or 1, and ensure that the input is a positive integer. The code should start with: ```python def calculate_factorial...
Here is the Python code to solve the given problem in the markdown block: ```python def calculate_factorial_iterative(n: int) -> int: """ Calculate the factorial of a given positive integer using an iterative approach. Parameters: n (int): A positive integer for which the factorial is to be calculated....
code_exercise_27k
172
Write a Python function named `calculate_mode` that takes a list of numbers as input and returns the mode(s) as a list. The mode is the number(s) that appear most frequently in the list. If there are multiple numbers with the same highest frequency, the function should return all of them. The code should start with: `...
Here is the Python code to solve the given problem in the markdown block: ```python from typing import List from collections import Counter def calculate_mode(numbers: List[int]) -> List[int]: """ Calculate the mode(s) of a list of numbers. The mode is the number(s) that appear most frequently in the list...
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
23