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 simple python script to print fibo numbers
- Assistant
Certainly! Below is a simple Python script to print Fibonacci numbers. Fibonacci sequence starts with two numbers - 0 and 1, where each number is the sum of the two preceding ones:
pythondef fibo(n): a, b = 0, 1 for _ in range(n): print(a, end=' ') a, b = b, a+b # Print the first 10 Fibonacci numbers fibo(10)When you run this script, it will print the first 10 numbers in the Fibonacci sequence. You can change the argument to
fibo()to print as many Fibonacci numbers as you'd like.