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:
Vardhaman
2022-07-07 20:04:07 +05:30
committed by GitHub
parent 0a0f4986e4
commit 2d5dd6f132
18 changed files with 39 additions and 44 deletions

View File

@ -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: