File: example.py

package info (click to toggle)
pygments 2.14.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 8,496 kB
  • sloc: python: 96,379; javascript: 238; makefile: 191; sh: 80; lisp: 74
file content (14 lines) | stat: -rw-r--r-- 316 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from typing import Iterator

# This is an example
class Math:
    @staticmethod
    def fib(n: int) -> Iterator[int]:
        """Fibonacci series up to n."""
        a, b = 0, 1
        while a < n:
            yield a
            a, b = b, a + b

result = sum(Math.fib(42))
print("The answer is {}".format(result))