conversations
listlengths
2
2
source
stringclasses
8 values
[ { "role": "user", "content": "Write `power_recursive` in Python. It should compute base^exp recursively. Make it robust to invalid input." }, { "role": "assistant", "content": "def power(base, exp: int):\n if not isinstance(exp, int):\n raise TypeError(\"exp must be int\")\n if exp ...
recursion
[ { "role": "user", "content": "Formulate `power_recursive` to compute base^exp recursively. Include basic type checks." }, { "role": "assistant", "content": "def power(base, exp: int):\n if not isinstance(exp, int):\n raise TypeError(\"exp must be int\")\n if exp < 0:\n return...
recursion
[ { "role": "user", "content": "Make a function `power_recursive` to compute base^exp recursively. " }, { "role": "assistant", "content": "def power(base, exp: int):\n if not isinstance(exp, int):\n raise TypeError(\"exp must be int\")\n if exp < 0:\n return 1 / power(base, -ex...
recursion
[ { "role": "user", "content": "Create a utility function named `power_recursive` which compute base^exp recursively. Add a brief docstring." }, { "role": "assistant", "content": "def power(base, exp: int):\n if not isinstance(exp, int):\n raise TypeError(\"exp must be int\")\n if exp...
recursion
[ { "role": "user", "content": "Write `power_recursive` handling edge cases; it should compute base^exp recursively. Add a brief docstring." }, { "role": "assistant", "content": "def power(base, exp: int):\n if not isinstance(exp, int):\n raise TypeError(\"exp must be int\")\n if exp ...
recursion
[ { "role": "user", "content": "Produce a clean implementation of `power_recursive`: compute base^exp recursively. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def power(base, exp: int):\n if not isinstance(exp, int):\n raise TypeError(\"exp must be int...
recursion
[ { "role": "user", "content": "Create a utility function named `power_recursive` which compute base^exp recursively. " }, { "role": "assistant", "content": "def power(base, exp: int):\n if not isinstance(exp, int):\n raise TypeError(\"exp must be int\")\n if exp < 0:\n return ...
recursion
[ { "role": "user", "content": "Write a reusable function `power_recursive` which compute base^exp recursively. Keep it efficient." }, { "role": "assistant", "content": "def power(base, exp: int):\n if not isinstance(exp, int):\n raise TypeError(\"exp must be int\")\n if exp < 0:\n ...
recursion
[ { "role": "user", "content": "Implement `power_recursive` returning the power given base and exp. Handle empty input gracefully." }, { "role": "assistant", "content": "def power(base, exp: int):\n if not isinstance(exp, int):\n raise TypeError(\"exp must be int\")\n if exp < 0:\n ...
recursion
[ { "role": "user", "content": "Write `power_recursive` in Python. It should compute base^exp recursively. Add a brief docstring." }, { "role": "assistant", "content": "def power(base, exp: int):\n if not isinstance(exp, int):\n raise TypeError(\"exp must be int\")\n if exp < 0:\n ...
recursion
[ { "role": "user", "content": "Construct `power_recursive` to compute base^exp recursively. " }, { "role": "assistant", "content": "def power(base, exp: int):\n if not isinstance(exp, int):\n raise TypeError(\"exp must be int\")\n if exp < 0:\n return 1 / power(base, -exp)\n ...
recursion
[ { "role": "user", "content": "Produce a clean implementation of `power_recursive`: compute base^exp recursively. Use only the standard library." }, { "role": "assistant", "content": "def power(base, exp: int):\n if not isinstance(exp, int):\n raise TypeError(\"exp must be int\")\n i...
recursion
[ { "role": "user", "content": "Construct `power_recursive` to compute base^exp recursively. Avoid mutating the input." }, { "role": "assistant", "content": "def power(base, exp: int):\n if not isinstance(exp, int):\n raise TypeError(\"exp must be int\")\n if exp < 0:\n return ...
recursion
[ { "role": "user", "content": "Create a utility function named `power_recursive` which compute base^exp recursively. Keep it efficient." }, { "role": "assistant", "content": "def power(base, exp: int):\n if not isinstance(exp, int):\n raise TypeError(\"exp must be int\")\n if exp < 0...
recursion
[ { "role": "user", "content": "I need a Python helper `sum_list_recursive` that sum a list recursively. Use only the standard library." }, { "role": "assistant", "content": "def sum_list_recursive(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a li...
recursion
[ { "role": "user", "content": "Define a function `sum_list_recursive` taking a list nums and returning the sum. Include basic type checks." }, { "role": "assistant", "content": "def sum_list_recursive(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be ...
recursion
[ { "role": "user", "content": "Implement `sum_list_recursive`. It should sum a list recursively. Keep it efficient." }, { "role": "assistant", "content": "def sum_list_recursive(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n if not n...
recursion
[ { "role": "user", "content": "Define a function `sum_list_recursive` taking a list nums and returning the sum. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def sum_list_recursive(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\...
recursion
[ { "role": "user", "content": "Create a utility function named `sum_list_recursive` which sum a list recursively. Use only the standard library." }, { "role": "assistant", "content": "def sum_list_recursive(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums mu...
recursion
[ { "role": "user", "content": "Construct `sum_list_recursive` to sum a list recursively. Add a brief docstring." }, { "role": "assistant", "content": "def sum_list_recursive(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n if not nums:...
recursion
[ { "role": "user", "content": "Create a robust `sum_list_recursive` that sum a list recursively. Make it robust to invalid input." }, { "role": "assistant", "content": "def sum_list_recursive(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")...
recursion
[ { "role": "user", "content": "Produce a clean implementation of `sum_list_recursive`: sum a list recursively. Handle empty input gracefully." }, { "role": "assistant", "content": "def sum_list_recursive(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must ...
recursion
[ { "role": "user", "content": "I need a Python helper `sum_list_recursive` that sum a list recursively. Add a brief docstring." }, { "role": "assistant", "content": "def sum_list_recursive(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n ...
recursion
[ { "role": "user", "content": "Make a function `sum_list_recursive` to sum a list recursively. Use only the standard library." }, { "role": "assistant", "content": "def sum_list_recursive(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n ...
recursion
[ { "role": "user", "content": "Implement `sum_list_recursive` with proper validation: sum a list recursively. Avoid mutating the input." }, { "role": "assistant", "content": "def sum_list_recursive(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a l...
recursion
[ { "role": "user", "content": "Help me write `sum_list_recursive` that sum a list recursively. Handle empty input gracefully." }, { "role": "assistant", "content": "def sum_list_recursive(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n ...
recursion
[ { "role": "user", "content": "Formulate `sum_list_recursive` to sum a list recursively. Use only the standard library." }, { "role": "assistant", "content": "def sum_list_recursive(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n if n...
recursion
[ { "role": "user", "content": "Provide a Python solution for `sum_list_recursive`: sum a list recursively. " }, { "role": "assistant", "content": "def sum_list_recursive(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n if not nums:\n ...
recursion
[ { "role": "user", "content": "Implement the function `sum_list_recursive` (a list nums) -> the sum. " }, { "role": "assistant", "content": "def sum_list_recursive(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n if not nums:\n ...
recursion
[ { "role": "user", "content": "Create a robust `sum_list_recursive` that sum a list recursively. Handle empty input gracefully." }, { "role": "assistant", "content": "def sum_list_recursive(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n...
recursion
[ { "role": "user", "content": "Implement `sum_list_recursive`. It should sum a list recursively. Handle empty input gracefully." }, { "role": "assistant", "content": "def sum_list_recursive(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n...
recursion
[ { "role": "user", "content": "Formulate `sum_list_recursive` to sum a list recursively. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def sum_list_recursive(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")...
recursion
[ { "role": "user", "content": "Write a reusable function `sum_list_recursive` which sum a list recursively. Make it robust to invalid input." }, { "role": "assistant", "content": "def sum_list_recursive(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must b...
recursion
[ { "role": "user", "content": "Produce a clean implementation of `sum_list_recursive`: sum a list recursively. Avoid mutating the input." }, { "role": "assistant", "content": "def sum_list_recursive(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a ...
recursion
[ { "role": "user", "content": "Implement `sum_list_recursive(a list nums)` to sum a list recursively. Handle empty input gracefully." }, { "role": "assistant", "content": "def sum_list_recursive(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list...
recursion
[ { "role": "user", "content": "Generate a Python function `sum_list_recursive` for sum a list recursively. " }, { "role": "assistant", "content": "def sum_list_recursive(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n if not nums:\n ...
recursion
[ { "role": "user", "content": "Build a function `sum_list_recursive` that sum a list recursively, with edge-case handling. Include basic type checks." }, { "role": "assistant", "content": "def sum_list_recursive(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nu...
recursion
[ { "role": "user", "content": "Please provide `sum_list_recursive` that sum a list recursively. Avoid mutating the input." }, { "role": "assistant", "content": "def sum_list_recursive(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n if...
recursion
[ { "role": "user", "content": "Can you write code for `sum_list_recursive` that sum a list recursively? Avoid mutating the input." }, { "role": "assistant", "content": "def sum_list_recursive(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")...
recursion
[ { "role": "user", "content": "Write a reusable function `sum_list_recursive` which sum a list recursively. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def sum_list_recursive(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"num...
recursion
[ { "role": "user", "content": "Create `sum_list_recursive(a list nums)` returning the sum. Make it robust to invalid input." }, { "role": "assistant", "content": "def sum_list_recursive(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n ...
recursion
[ { "role": "user", "content": "Implement `sum_list_recursive` returning the sum given a list nums. Use only the standard library." }, { "role": "assistant", "content": "def sum_list_recursive(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")...
recursion
[ { "role": "user", "content": "I need a Python helper `sum_list_recursive` that sum a list recursively. Make it robust to invalid input." }, { "role": "assistant", "content": "def sum_list_recursive(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a ...
recursion
[ { "role": "user", "content": "Implement `sum_list_recursive` with proper validation: sum a list recursively. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def sum_list_recursive(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"n...
recursion
[ { "role": "user", "content": "Build a function `sum_list_recursive` that sum a list recursively, with edge-case handling. Make it robust to invalid input." }, { "role": "assistant", "content": "def sum_list_recursive(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeErro...
recursion
[ { "role": "user", "content": "Write `gcd_recursive` handling edge cases; it should compute gcd recursively. Use only the standard library." }, { "role": "assistant", "content": "def gcd_recursive(a: int, b: int) -> int:\n if not (isinstance(a, int) and isinstance(b, int)):\n raise Type...
recursion
[ { "role": "user", "content": "Write `gcd_recursive`: compute gcd recursively. Add a brief docstring." }, { "role": "assistant", "content": "def gcd_recursive(a: int, b: int) -> int:\n if not (isinstance(a, int) and isinstance(b, int)):\n raise TypeError(\"a and b must be int\")\n a,...
recursion
[ { "role": "user", "content": "Implement `gcd_recursive` with proper validation: compute gcd recursively. Handle empty input gracefully." }, { "role": "assistant", "content": "def gcd_recursive(a: int, b: int) -> int:\n if not (isinstance(a, int) and isinstance(b, int)):\n raise TypeErr...
recursion
[ { "role": "user", "content": "Generate a Python function `gcd_recursive` for compute gcd recursively. Handle empty input gracefully." }, { "role": "assistant", "content": "def gcd_recursive(a: int, b: int) -> int:\n if not (isinstance(a, int) and isinstance(b, int)):\n raise TypeError(...
recursion
[ { "role": "user", "content": "Implement `gcd_recursive`. It should compute gcd recursively. " }, { "role": "assistant", "content": "def gcd_recursive(a: int, b: int) -> int:\n if not (isinstance(a, int) and isinstance(b, int)):\n raise TypeError(\"a and b must be int\")\n a, b = abs...
recursion
[ { "role": "user", "content": "I need a Python helper `gcd_recursive` that compute gcd recursively. Add a brief docstring." }, { "role": "assistant", "content": "def gcd_recursive(a: int, b: int) -> int:\n if not (isinstance(a, int) and isinstance(b, int)):\n raise TypeError(\"a and b m...
recursion
[ { "role": "user", "content": "Develop `gcd_recursive` such that it compute gcd recursively. Make it robust to invalid input." }, { "role": "assistant", "content": "def gcd_recursive(a: int, b: int) -> int:\n if not (isinstance(a, int) and isinstance(b, int)):\n raise TypeError(\"a and ...
recursion
[ { "role": "user", "content": "Generate a Python function `gcd_recursive` for compute gcd recursively. Use only the standard library." }, { "role": "assistant", "content": "def gcd_recursive(a: int, b: int) -> int:\n if not (isinstance(a, int) and isinstance(b, int)):\n raise TypeError(...
recursion
[ { "role": "user", "content": "Write a Python function `gcd_recursive` that compute gcd recursively. " }, { "role": "assistant", "content": "def gcd_recursive(a: int, b: int) -> int:\n if not (isinstance(a, int) and isinstance(b, int)):\n raise TypeError(\"a and b must be int\")\n a,...
recursion
[ { "role": "user", "content": "Write a reusable function `gcd_recursive` which compute gcd recursively. Avoid mutating the input." }, { "role": "assistant", "content": "def gcd_recursive(a: int, b: int) -> int:\n if not (isinstance(a, int) and isinstance(b, int)):\n raise TypeError(\"a ...
recursion
[ { "role": "user", "content": "Make a function `gcd_recursive` to compute gcd recursively. Make it robust to invalid input." }, { "role": "assistant", "content": "def gcd_recursive(a: int, b: int) -> int:\n if not (isinstance(a, int) and isinstance(b, int)):\n raise TypeError(\"a and b ...
recursion
[ { "role": "user", "content": "Write a reusable function `gcd_recursive` which compute gcd recursively. Add a brief docstring." }, { "role": "assistant", "content": "def gcd_recursive(a: int, b: int) -> int:\n if not (isinstance(a, int) and isinstance(b, int)):\n raise TypeError(\"a and...
recursion
[ { "role": "user", "content": "Produce a clean implementation of `gcd_recursive`: compute gcd recursively. Use only the standard library." }, { "role": "assistant", "content": "def gcd_recursive(a: int, b: int) -> int:\n if not (isinstance(a, int) and isinstance(b, int)):\n raise TypeEr...
recursion
[ { "role": "user", "content": "Develop `gcd_recursive` such that it compute gcd recursively. Handle empty input gracefully." }, { "role": "assistant", "content": "def gcd_recursive(a: int, b: int) -> int:\n if not (isinstance(a, int) and isinstance(b, int)):\n raise TypeError(\"a and b ...
recursion
[ { "role": "user", "content": "Make a function `gcd_recursive` to compute gcd recursively. Include basic type checks." }, { "role": "assistant", "content": "def gcd_recursive(a: int, b: int) -> int:\n if not (isinstance(a, int) and isinstance(b, int)):\n raise TypeError(\"a and b must b...
recursion
[ { "role": "user", "content": "Formulate `gcd_recursive` to compute gcd recursively. Handle empty input gracefully." }, { "role": "assistant", "content": "def gcd_recursive(a: int, b: int) -> int:\n if not (isinstance(a, int) and isinstance(b, int)):\n raise TypeError(\"a and b must be ...
recursion
[ { "role": "user", "content": "Write a reusable function `gcd_recursive` which compute gcd recursively. Handle empty input gracefully." }, { "role": "assistant", "content": "def gcd_recursive(a: int, b: int) -> int:\n if not (isinstance(a, int) and isinstance(b, int)):\n raise TypeError...
recursion
[ { "role": "user", "content": "Create a utility function named `gcd_recursive` which compute gcd recursively. Handle empty input gracefully." }, { "role": "assistant", "content": "def gcd_recursive(a: int, b: int) -> int:\n if not (isinstance(a, int) and isinstance(b, int)):\n raise Typ...
recursion
[ { "role": "user", "content": "Implement `gcd_recursive` returning the gcd given integers a and b. " }, { "role": "assistant", "content": "def gcd_recursive(a: int, b: int) -> int:\n if not (isinstance(a, int) and isinstance(b, int)):\n raise TypeError(\"a and b must be int\")\n a, b...
recursion
[ { "role": "user", "content": "Implement `gcd_recursive`. It should compute gcd recursively. Use only the standard library." }, { "role": "assistant", "content": "def gcd_recursive(a: int, b: int) -> int:\n if not (isinstance(a, int) and isinstance(b, int)):\n raise TypeError(\"a and b ...
recursion
[ { "role": "user", "content": "Write `gcd_recursive`: compute gcd recursively. Use only the standard library." }, { "role": "assistant", "content": "def gcd_recursive(a: int, b: int) -> int:\n if not (isinstance(a, int) and isinstance(b, int)):\n raise TypeError(\"a and b must be int\")...
recursion
[ { "role": "user", "content": "Write a Python function `gcd_recursive` that compute gcd recursively. Handle empty input gracefully." }, { "role": "assistant", "content": "def gcd_recursive(a: int, b: int) -> int:\n if not (isinstance(a, int) and isinstance(b, int)):\n raise TypeError(\"...
recursion
[ { "role": "user", "content": "Make a function `gcd_recursive` to compute gcd recursively. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def gcd_recursive(a: int, b: int) -> int:\n if not (isinstance(a, int) and isinstance(b, int)):\n raise TypeError(\"...
recursion
[ { "role": "user", "content": "Produce a clean implementation of `gcd_recursive`: compute gcd recursively. " }, { "role": "assistant", "content": "def gcd_recursive(a: int, b: int) -> int:\n if not (isinstance(a, int) and isinstance(b, int)):\n raise TypeError(\"a and b must be int\")\n...
recursion
[ { "role": "user", "content": "Produce a clean implementation of `gcd_recursive`: compute gcd recursively. Make it robust to invalid input." }, { "role": "assistant", "content": "def gcd_recursive(a: int, b: int) -> int:\n if not (isinstance(a, int) and isinstance(b, int)):\n raise Type...
recursion
[ { "role": "user", "content": "Provide a Python solution for `gcd_recursive`: compute gcd recursively. Avoid mutating the input." }, { "role": "assistant", "content": "def gcd_recursive(a: int, b: int) -> int:\n if not (isinstance(a, int) and isinstance(b, int)):\n raise TypeError(\"a a...
recursion
[ { "role": "user", "content": "Write a reusable function `gcd_recursive` which compute gcd recursively. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def gcd_recursive(a: int, b: int) -> int:\n if not (isinstance(a, int) and isinstance(b, int)):\n raise...
recursion
[ { "role": "user", "content": "Write `gcd_recursive` in Python. It should compute gcd recursively. " }, { "role": "assistant", "content": "def gcd_recursive(a: int, b: int) -> int:\n if not (isinstance(a, int) and isinstance(b, int)):\n raise TypeError(\"a and b must be int\")\n a, b...
recursion
[ { "role": "user", "content": "Can you write code for `gcd_recursive` that compute gcd recursively? " }, { "role": "assistant", "content": "def gcd_recursive(a: int, b: int) -> int:\n if not (isinstance(a, int) and isinstance(b, int)):\n raise TypeError(\"a and b must be int\")\n a, ...
recursion
[ { "role": "user", "content": "I need a Python helper `gcd_recursive` that compute gcd recursively. Keep it efficient." }, { "role": "assistant", "content": "def gcd_recursive(a: int, b: int) -> int:\n if not (isinstance(a, int) and isinstance(b, int)):\n raise TypeError(\"a and b must ...
recursion
[ { "role": "user", "content": "Help me write `gcd_recursive` that compute gcd recursively. Keep it efficient." }, { "role": "assistant", "content": "def gcd_recursive(a: int, b: int) -> int:\n if not (isinstance(a, int) and isinstance(b, int)):\n raise TypeError(\"a and b must be int\")...
recursion
[ { "role": "user", "content": "Implement `reverse_recursive(a string s)` to reverse a string recursively. Add a brief docstring." }, { "role": "assistant", "content": "def reverse_recursive(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n if len(s...
recursion
[ { "role": "user", "content": "Implement the function `reverse_recursive` (a string s) -> the reversed string. Keep it efficient." }, { "role": "assistant", "content": "def reverse_recursive(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n if len(...
recursion
[ { "role": "user", "content": "Make a function `reverse_recursive` to reverse a string recursively. Avoid mutating the input." }, { "role": "assistant", "content": "def reverse_recursive(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n if len(s) <...
recursion
[ { "role": "user", "content": "Implement the function `reverse_recursive` (a string s) -> the reversed string. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def reverse_recursive(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s must be...
recursion
[ { "role": "user", "content": "Create a robust `reverse_recursive` that reverse a string recursively. Use only the standard library." }, { "role": "assistant", "content": "def reverse_recursive(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n if l...
recursion
[ { "role": "user", "content": "Write code for `reverse_recursive` (a string s) that reverse a string recursively. Include basic type checks." }, { "role": "assistant", "content": "def reverse_recursive(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n...
recursion
[ { "role": "user", "content": "Produce a clean implementation of `reverse_recursive`: reverse a string recursively. " }, { "role": "assistant", "content": "def reverse_recursive(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n if len(s) <= 1:\n ...
recursion
[ { "role": "user", "content": "Make a function `reverse_recursive` to reverse a string recursively. Handle empty input gracefully." }, { "role": "assistant", "content": "def reverse_recursive(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n if len...
recursion
[ { "role": "user", "content": "Build a function `reverse_recursive` that reverse a string recursively, with edge-case handling. Add a brief docstring." }, { "role": "assistant", "content": "def reverse_recursive(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s must be ...
recursion
[ { "role": "user", "content": "Write `reverse_recursive` in Python. It should reverse a string recursively. Avoid mutating the input." }, { "role": "assistant", "content": "def reverse_recursive(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n if ...
recursion
[ { "role": "user", "content": "Formulate `reverse_recursive` to reverse a string recursively. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def reverse_recursive(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n if...
recursion
[ { "role": "user", "content": "Build a function `reverse_recursive` that reverse a string recursively, with edge-case handling. Make it robust to invalid input." }, { "role": "assistant", "content": "def reverse_recursive(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"...
recursion
[ { "role": "user", "content": "Produce a clean implementation of `reverse_recursive`: reverse a string recursively. Keep it efficient." }, { "role": "assistant", "content": "def reverse_recursive(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n if...
recursion
[ { "role": "user", "content": "Draft a Python function `reverse_recursive` to reverse a string recursively. Use only the standard library." }, { "role": "assistant", "content": "def reverse_recursive(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n ...
recursion
[ { "role": "user", "content": "Please provide `reverse_recursive` that reverse a string recursively. Use only the standard library." }, { "role": "assistant", "content": "def reverse_recursive(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n if le...
recursion
[ { "role": "user", "content": "Write a reusable function `reverse_recursive` which reverse a string recursively. Use only the standard library." }, { "role": "assistant", "content": "def reverse_recursive(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\"...
recursion
[ { "role": "user", "content": "Add a function `reverse_recursive` that reverse a string recursively. " }, { "role": "assistant", "content": "def reverse_recursive(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n if len(s) <= 1:\n return s\n...
recursion
[ { "role": "user", "content": "I need a Python helper `reverse_recursive` that reverse a string recursively. Add a brief docstring." }, { "role": "assistant", "content": "def reverse_recursive(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n if le...
recursion
[ { "role": "user", "content": "Write a reusable function `reverse_recursive` which reverse a string recursively. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def reverse_recursive(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s must ...
recursion
[ { "role": "user", "content": "Implement `reverse_recursive` returning the reversed string given a string s. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def reverse_recursive(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s must be a...
recursion
[ { "role": "user", "content": "Define a function `reverse_recursive` taking a string s and returning the reversed string. " }, { "role": "assistant", "content": "def reverse_recursive(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n if len(s) <= 1...
recursion
[ { "role": "user", "content": "Create a robust `reverse_recursive` that reverse a string recursively. Avoid mutating the input." }, { "role": "assistant", "content": "def reverse_recursive(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n if len(s)...
recursion
[ { "role": "user", "content": "Formulate `reverse_recursive` to reverse a string recursively. Keep it efficient." }, { "role": "assistant", "content": "def reverse_recursive(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n if len(s) <= 1:\n ...
recursion
[ { "role": "user", "content": "Implement `reverse_recursive` with proper validation: reverse a string recursively. Keep it efficient." }, { "role": "assistant", "content": "def reverse_recursive(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n if ...
recursion