Message358375
I think it's appropriate to add the generator fib() to the math module. With fib(), some operations will be easier.
The generator is like this:
def fib(count=None):
if count is not None and not isinstance(count, int):
raise ValueError(f"Parameter count has an unexpected type: {count.__class__.__name__}.")
a, b = 0, 1
while True:
a, b = b, a + b
if count is not None:
if not count:
return
count -= 1
yield a |
|
Date |
User |
Action |
Args |
2019-12-14 04:43:56 | lovi | set | recipients:
+ lovi |
2019-12-14 04:43:56 | lovi | set | messageid: <1576298636.18.0.950547793455.issue39043@roundup.psfhosted.org> |
2019-12-14 04:43:56 | lovi | link | issue39043 messages |
2019-12-14 04:43:55 | lovi | create | |
|