mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-18 18:14:34 +08:00
Add typehints ciphers and bool alg (#3264)
* updating DIRECTORY.md * updating DIRECTORY.md * Fixed accidental commit of file I have't touched * fixup! Format Python code with psf/black push * updating DIRECTORY.md * updating DIRECTORY.md * Fixed some suggested coding style issues * Update rsa_key_generator.py * Update rsa_key_generator.py Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Co-authored-by: John Law <johnlaw.po@gmail.com>
This commit is contained in:
@ -57,7 +57,7 @@ MORSE_CODE_DICT = {
|
||||
}
|
||||
|
||||
|
||||
def encrypt(message):
|
||||
def encrypt(message: str) -> str:
|
||||
cipher = ""
|
||||
for letter in message:
|
||||
if letter != " ":
|
||||
@ -69,7 +69,7 @@ def encrypt(message):
|
||||
return cipher[:-1]
|
||||
|
||||
|
||||
def decrypt(message):
|
||||
def decrypt(message: str) -> str:
|
||||
decipher = ""
|
||||
letters = message.split(" ")
|
||||
for letter in letters:
|
||||
|
Reference in New Issue
Block a user