chore: update workspace config and memory
This commit is contained in:
16
test_fib.py
Normal file
16
test_fib.py
Normal file
@@ -0,0 +1,16 @@
|
||||
def fibonacci(n):
|
||||
"""Return a list containing the Fibonacci sequence up to n terms."""
|
||||
if n <= 0:
|
||||
return []
|
||||
|
||||
sequence = []
|
||||
a, b = 0, 1
|
||||
for _ in range(n):
|
||||
sequence.append(a)
|
||||
a, b = b, a + b
|
||||
return sequence
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
terms = 10
|
||||
print(f"First {terms} Fibonacci terms: {fibonacci(terms)}")
|
||||
Reference in New Issue
Block a user