← Toate task-urile
Task AI
36d5a88be2242312a527a74819ceedd5
rewarded
Timeline
PROMPT UTILIZATOR
Trimis de: 7a8b70389a…b7a1e2e1ca
Tip: chat · Fee: 1.000000 OMBRA
Write a Python function that calculates fibonacci recursively
RĂSPUNSURI MINERI (2)
#1
Miner: 73c816c483…3660641830
NFT: 8f96b9dd…57e30cb1
🧠 openai-compatible:google/gemma-4-e2b⏱ 9.4s🎫 ? → 120⭐ Score: 96/100
Răspuns
```python
def fibonacci_recursive(n):
"""
Calculates the n-th Fibonacci number using recursion.
"""
if n <= 0:
return 0
elif n == 1:
return 1
else:
# Recursive step: F(n) = F(n-1) + F(n-2)
return fibonacci_recursive(n - 1) + fibonacci_recursive(n - 2)
# Example usage:
number = 8
result = fibonacci_recursive(number)
print(f"The {number}-th Fibonacci number is: {result}") # Output: The 8-th Fibonacci number is: 21
```#2
Miner: 09af24a136…236918c2ca
NFT: 1aea4db9…e2b6580c
🧠 openai-compatible:google/gemma-4-e2b⏱ 7.0s🎫 ? → 118
Răspuns
```python
def fibonacci(n):
"""
Calculates the nth Fibonacci number recursively.
Assumes n is a non-negative integer.
"""
if n <= 0:
return 0
elif n == 1:
return 1
else:
# Recursive step: F(n) = F(n-1) + F(n-2)
return fibonacci(n - 1) + fibonacci(n - 2)
# Example usage:
number = 8
result = fibonacci(number)
print(f"The {number}th Fibonacci number is: {result}") # Output: The 8th Fibonacci number is: 21
```VALIDARE LLM-AS-JUDGE
Scoruri
⭐ 8f96b9dd88c7…428857e30cb1
96/100
Corect și precis: oferă funcție recursivă validă, condiții de bază și pas recursiv, plus exemplu clar; acoperă complet cerința și este bine formulat.