Give me a code to print fibinocci series in python
- User
Give me a code to print fibinocci series in python
Assistant
# Python program to print Fibonacci series # up to n terms def fibonacci(n): if n < 0: print("Incorrect input") elif n == 0: return 0 elif n == 1: return 1 else: return fibonacci(n - 1) + fibonacci(n - 2) # Driver code n = int(input("Enter the number of terms to print: ")) for i in range(n): print(fibonacci(i))
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.