gpt-4-1106-preview· openai
Suzhen/CodeChat
START OF PREVIOUS DISCUSSION END OF PREVIOUS DISCUSSION
- User
START OF PREVIOUS DISCUSSION END OF PREVIOUS DISCUSSION user: make a pythons cript to print fibonnanci numbers
- Assistant
Certainly! Below is a simple Python script that prints the first 10 numbers in the Fibonacci sequence:
def fibonacci(n): a, b = 0, 1 for _ in range(n): print(a, end=" ") a, b = b, a + b fibonacci(10)If you run this script, it will display the following numbers, which are the first 10 numbers in the Fibonacci sequence:
0 1 1 2 3 5 8 13 21 34Each number in the sequence is the sum of the two preceding ones, starting from 0 and 1. The function
fibonacci(n)takes an argumentnwhich determines the number of elements in the Fibonacci sequence to print.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.