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
Here's a simple Python script that will print the Fibonacci sequence up to a certain number. The Fibonacci sequence is a series of numbers where a number is the addition of the last two numbers, starting with 0 and 1.
# A simple python script to print Fibonacci numbers def fibonacci(n): a, b = 0, 1 for _ in range(n): print(a, end=' ') a, b = b, a + b # Input from the user to determine how many Fibonacci numbers to print num_of_fib_numbers = int(input("How many Fibonacci numbers would you like to see? ")) # Call the function and print the numbers fibonacci(num_of_fib_numbers)When you run this script, it will ask you how many Fibonacci numbers you would like to see. After you input the desired count, it will print out that many numbers from the Fibonacci sequence. This script uses a for-loop based iteration approach, and it will start the sequence with 0 followed by 1, and so on.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
- gpt-4-1106-previewCompare side by side →
- gpt-4-1106-previewCompare side by side →
- gpt-4-1106-previewCompare side by side →
- gpt-4-1106-previewCompare side by side →
- gpt-4-1106-previewCompare side by side →
- gpt-4-1106-previewCompare side by side →
- gpt-4-1106-previewCompare side by side →
- gpt-4-1106-previewCompare side by side →
- gpt-4-1106-previewCompare side by side →
- gpt-4-1106-previewCompare side by side →
- gpt-4-1106-previewCompare side by side →
- gpt-4-1106-previewCompare side by side →