mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-23 21:11:08 +00:00
fix: mypy 0.991 issues (#7988)
* fix: mypy 0.991 issues * fix: invalid condition for base case
This commit is contained in:
parent
4ce8ad9ce6
commit
8bfd1c844b
|
@ -76,8 +76,9 @@ def decimal_to_any(num: int, base: int) -> str:
|
|||
div, mod = divmod(num, base)
|
||||
if base >= 11 and 9 < mod < 36:
|
||||
actual_value = ALPHABET_VALUES[str(mod)]
|
||||
mod = actual_value
|
||||
new_value += str(mod)
|
||||
else:
|
||||
actual_value = str(mod)
|
||||
new_value += actual_value
|
||||
div = num // base
|
||||
num = div
|
||||
if div == 0:
|
||||
|
|
|
@ -49,7 +49,7 @@ class LinkedList:
|
|||
>>> print(linked_list)
|
||||
9 --> 14 --> 23
|
||||
"""
|
||||
if not self.is_empty:
|
||||
if self.is_empty():
|
||||
return ""
|
||||
else:
|
||||
iterate = self.head
|
||||
|
|
|
@ -345,7 +345,7 @@ class Matrix:
|
|||
if other == 0:
|
||||
return self.identity()
|
||||
if other < 0:
|
||||
if self.is_invertable:
|
||||
if self.is_invertable():
|
||||
return self.inverse() ** (-other)
|
||||
raise ValueError(
|
||||
"Only invertable matrices can be raised to a negative power"
|
||||
|
|
Loading…
Reference in New Issue
Block a user