Conditions | 6 |
Total Lines | 16 |
Code Lines | 13 |
Lines | 16 |
Ratio | 100 % |
Changes | 0 |
1 | View Code Duplication | class Counter: |
|
14 | def leading_zeros(self): |
||
15 | if self.length == 3: |
||
16 | if self.counter < 10: |
||
17 | count = "00" + str(self.counter) |
||
18 | elif 9 < self.counter < 100: |
||
19 | count = "0" + str(self.counter) |
||
20 | else: |
||
21 | count = self.counter |
||
22 | elif self.length == 2: |
||
23 | if self.counter < 10: |
||
24 | count = "0" + str(self.counter) |
||
25 | else: |
||
26 | count = self.counter |
||
27 | else: |
||
28 | count = self.counter |
||
29 | return count |
||
30 | |||
41 |