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: hi, make a python script that prints fibo jnumbers
- Assistant
Sure, here's a simple Python script that prints the Fibonacci sequence. By default, it will print the first 10 Fibonacci numbers, but you can change the
num_fibo_numbersvariable to print more or fewer numbers.pythondef fibonacci(n): fibo_seq = [] a, b = 0, 1 for _ in range(n): fibo_seq.append(a) a, b = b, a + b return fibo_seq num_fibo_numbers = 10 # Set the number of Fibonacci numbers you want to print for number in fibonacci(num_fibo_numbers): print(number)If you run this script, it will output the first 10 numbers in the Fibonacci sequence:
code0 1 1 2 3 5 8 13 21 34
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.