Skip to content

Commit 8bb7b8f

Browse files
nikalosagithub-actionscclauss
authored
Fix syntax for flake8 passing (TheAlgorithms#2096)
* Fix syntax for flake8 passing * fixup! Format Python code with psf/black push * # fmt: off / # fmt: on * updating DIRECTORY.md Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Co-authored-by: Christian Clauss <[email protected]>
1 parent ec2d900 commit 8bb7b8f

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

DIRECTORY.md

+4
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
* [Harriscorner](https://github.com/TheAlgorithms/Python/blob/master/computer_vision/harriscorner.py)
7777

7878
## Conversions
79+
* [Decimal To Any](https://github.com/TheAlgorithms/Python/blob/master/conversions/decimal_to_any.py)
7980
* [Decimal To Binary](https://github.com/TheAlgorithms/Python/blob/master/conversions/decimal_to_binary.py)
8081
* [Decimal To Hexadecimal](https://github.com/TheAlgorithms/Python/blob/master/conversions/decimal_to_hexadecimal.py)
8182
* [Decimal To Octal](https://github.com/TheAlgorithms/Python/blob/master/conversions/decimal_to_octal.py)
@@ -267,6 +268,7 @@
267268
* [Enigma Machine](https://github.com/TheAlgorithms/Python/blob/master/hashes/enigma_machine.py)
268269
* [Hamming Code](https://github.com/TheAlgorithms/Python/blob/master/hashes/hamming_code.py)
269270
* [Md5](https://github.com/TheAlgorithms/Python/blob/master/hashes/md5.py)
271+
* [Sdbm](https://github.com/TheAlgorithms/Python/blob/master/hashes/sdbm.py)
270272
* [Sha1](https://github.com/TheAlgorithms/Python/blob/master/hashes/sha1.py)
271273

272274
## Linear Algebra
@@ -359,6 +361,7 @@
359361
* [Newton Raphson](https://github.com/TheAlgorithms/Python/blob/master/maths/newton_raphson.py)
360362
* [Number Of Digits](https://github.com/TheAlgorithms/Python/blob/master/maths/number_of_digits.py)
361363
* [Numerical Integration](https://github.com/TheAlgorithms/Python/blob/master/maths/numerical_integration.py)
364+
* [Perfect Cube](https://github.com/TheAlgorithms/Python/blob/master/maths/perfect_cube.py)
362365
* [Perfect Square](https://github.com/TheAlgorithms/Python/blob/master/maths/perfect_square.py)
363366
* [Pi Monte Carlo Estimation](https://github.com/TheAlgorithms/Python/blob/master/maths/pi_monte_carlo_estimation.py)
364367
* [Polynomial Evaluation](https://github.com/TheAlgorithms/Python/blob/master/maths/polynomial_evaluation.py)
@@ -644,6 +647,7 @@
644647
* [Split](https://github.com/TheAlgorithms/Python/blob/master/strings/split.py)
645648
* [Upper](https://github.com/TheAlgorithms/Python/blob/master/strings/upper.py)
646649
* [Word Occurrence](https://github.com/TheAlgorithms/Python/blob/master/strings/word_occurrence.py)
650+
* [Z Function](https://github.com/TheAlgorithms/Python/blob/master/strings/z_function.py)
647651

648652
## Traversals
649653
* [Binary Tree Traversals](https://github.com/TheAlgorithms/Python/blob/master/traversals/binary_tree_traversals.py)

conversions/decimal_to_any.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33

44
def decimal_to_any(num: int, base: int) -> str:
5-
65
"""
76
Convert a positive integer to another base as str.
87
>>> decimal_to_any(0, 2)
@@ -66,11 +65,12 @@ def decimal_to_any(num: int, base: int) -> str:
6665
raise ValueError("base must be >= 2")
6766
if base > 36:
6867
raise ValueError("base must be <= 36")
69-
68+
# fmt: off
7069
ALPHABET_VALUES = {'10': 'A', '11': 'B', '12': 'C', '13': 'D', '14': 'E', '15': 'F', '16': 'G', '17': 'H',
71-
'18': 'I', '19': 'J', '20': 'K', '21': 'L', '22': 'M', '23': 'N', '24': 'O', '25': 'P',
72-
'26': 'Q', '27': 'R', '28': 'S', '29': 'T', '30': 'U', '31': 'V', '32': 'W', '33': 'X',
73-
'34': 'Y', '35': 'Z'}
70+
'18': 'I', '19': 'J', '20': 'K', '21': 'L', '22': 'M', '23': 'N', '24': 'O', '25': 'P',
71+
'26': 'Q', '27': 'R', '28': 'S', '29': 'T', '30': 'U', '31': 'V', '32': 'W', '33': 'X',
72+
'34': 'Y', '35': 'Z'}
73+
# fmt: on
7474
new_value = ""
7575
mod = 0
7676
div = 0

maths/perfect_cube.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ def perfect_cube(n: int) -> bool:
1111
return (val * val * val) == n
1212

1313

14-
if(__name__ == '__main__'):
14+
if __name__ == "__main__":
1515
print(perfect_cube(27))
1616
print(perfect_cube(4))

strings/z_function.py

+1
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,5 @@ def find_pattern(pattern: str, input_str: str) -> int:
8686

8787
if __name__ == "__main__":
8888
import doctest
89+
8990
doctest.testmod()

0 commit comments

Comments
 (0)