Issues (8)

examples/actions/pythonactions/fibonacci.py (1 issue)

Check for usage of undefined variables

Best Practice Comprehensibility Minor
1
#!/usr/bin/env python
2
3
from __future__ import print_function
4
import sys
5
import traceback
6
7
from six.moves import map
8
9
10
def fib(n):
11
    if n < 2:
12
        return n
13
    return fib(n - 2) + fib(n - 1)
14
15
if __name__ == '__main__':
16
    try:
17
        startNumber = int(float(sys.argv[1]))
18
        endNumber = int(float(sys.argv[2]))
19
        results = map(str, map(fib, list(range(startNumber, endNumber))))
20
        results = ' '.join(results)
21
        print(results)
22
    except Exception as e:
23
        traceback.print_exc(file=sys.stderr)
24
        sys.exit(six.text_type(e))
0 ignored issues
show
Comprehensibility Best Practice introduced by Tomaz Muraus
Undefined variable 'six'
Loading history...
25