mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-12-18 01:00:15 +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)
|
div, mod = divmod(num, base)
|
||||||
if base >= 11 and 9 < mod < 36:
|
if base >= 11 and 9 < mod < 36:
|
||||||
actual_value = ALPHABET_VALUES[str(mod)]
|
actual_value = ALPHABET_VALUES[str(mod)]
|
||||||
mod = actual_value
|
else:
|
||||||
new_value += str(mod)
|
actual_value = str(mod)
|
||||||
|
new_value += actual_value
|
||||||
div = num // base
|
div = num // base
|
||||||
num = div
|
num = div
|
||||||
if div == 0:
|
if div == 0:
|
||||||
|
|
|
@ -49,7 +49,7 @@ class LinkedList:
|
||||||
>>> print(linked_list)
|
>>> print(linked_list)
|
||||||
9 --> 14 --> 23
|
9 --> 14 --> 23
|
||||||
"""
|
"""
|
||||||
if not self.is_empty:
|
if self.is_empty():
|
||||||
return ""
|
return ""
|
||||||
else:
|
else:
|
||||||
iterate = self.head
|
iterate = self.head
|
||||||
|
|
|
@ -345,7 +345,7 @@ class Matrix:
|
||||||
if other == 0:
|
if other == 0:
|
||||||
return self.identity()
|
return self.identity()
|
||||||
if other < 0:
|
if other < 0:
|
||||||
if self.is_invertable:
|
if self.is_invertable():
|
||||||
return self.inverse() ** (-other)
|
return self.inverse() ** (-other)
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"Only invertable matrices can be raised to a negative power"
|
"Only invertable matrices can be raised to a negative power"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user