mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 01:09:40 +08:00
MAINT: Updated f-string method (#6230)
* MAINT: Used f-string method Updated the code with f-string methods wherever required for a better and cleaner understanding of the code. * Updated files with f-string method * Update rsa_key_generator.py * Update rsa_key_generator.py * Update elgamal_key_generator.py * Update lru_cache.py I don't think this change is efficient but it might tackle the error as the error was due to using long character lines. * Update lru_cache.py * Update lru_cache.py Co-authored-by: cyai <seriesscar@gmail.com> Co-authored-by: Christian Clauss <cclauss@me.com>
This commit is contained in:
@ -10,7 +10,7 @@ text. The type of transposition cipher demonstrated under is the ROUTE cipher.
|
||||
|
||||
def main() -> None:
|
||||
message = input("Enter message: ")
|
||||
key = int(input("Enter key [2-%s]: " % (len(message) - 1)))
|
||||
key = int(input(f"Enter key [2-{len(message) - 1}]: "))
|
||||
mode = input("Encryption/Decryption [e/d]: ")
|
||||
|
||||
if mode.lower().startswith("e"):
|
||||
@ -19,7 +19,7 @@ def main() -> None:
|
||||
text = decryptMessage(key, message)
|
||||
|
||||
# Append pipe symbol (vertical bar) to identify spaces at the end.
|
||||
print("Output:\n%s" % (text + "|"))
|
||||
print(f"Output:\n{text + '|'}")
|
||||
|
||||
|
||||
def encryptMessage(key: int, message: str) -> str:
|
||||
|
Reference in New Issue
Block a user