MCPcopy Index your code
hub / github.com/trekhleb/learn-python / fibonacci_smaller_than

Function fibonacci_smaller_than

src/modules/fibonacci_module.py:21–28  ·  view source on GitHub ↗

Return Fibonacci series up to limit

(limit)

Source from the content-addressed store, hash-verified

19
20
21def fibonacci_smaller_than(limit):
22 """Return Fibonacci series up to limit"""
23 result = []
24 previous_number, current_number = 0, 1
25 while previous_number < limit:
26 result.append(previous_number)
27 previous_number, current_number = current_number, previous_number + current_number
28 return result
29
30
31# When you run a Python module with:

Callers 2

test_modulesFunction · 0.90

Calls

no outgoing calls

Tested by 1

test_modulesFunction · 0.72