mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-21 20:47:10 +08:00
hill_cipher.py: Use int()
to gracefully deal with float input (#12833)
* https://github.com/TheAlgorithms/Python/pull/12821#discussion_r2186998710
This commit is contained in:
@ -78,8 +78,10 @@ class HillCipher:
|
|||||||
'T'
|
'T'
|
||||||
>>> hill_cipher.replace_digits(26)
|
>>> hill_cipher.replace_digits(26)
|
||||||
'0'
|
'0'
|
||||||
|
>>> hill_cipher.replace_digits(26.1)
|
||||||
|
'0'
|
||||||
"""
|
"""
|
||||||
return self.key_string[(num)]
|
return self.key_string[int(num)]
|
||||||
|
|
||||||
def check_determinant(self) -> None:
|
def check_determinant(self) -> None:
|
||||||
"""
|
"""
|
||||||
|
Reference in New Issue
Block a user