Total Complexity | 3 |
Total Lines | 8 |
Duplicated Lines | 0 % |
1 | import math |
||
7 | class PascalRowAction(Action): |
||
8 | def run(self, **kwargs): |
||
9 | return PascalRowAction._compute_pascal_row(**kwargs) |
||
10 | |||
11 | @staticmethod |
||
12 | def _compute_pascal_row(row_index=0): |
||
13 | return [math.factorial(row_index) / (math.factorial(i) * math.factorial(row_index - i)) |
||
14 | for i in range(row_index + 1)] |
||
15 |