Skip to content

Commit bf30b18

Browse files
rohan472000pre-commit-ci[bot]cclauss
authored
Update linear_discriminant_analysis.py and rsa_cipher.py (TheAlgorithms#8680)
* Update rsa_cipher.py by replacing %s with {} * Update rsa_cipher.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update linear_discriminant_analysis.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update linear_discriminant_analysis.py * Update linear_discriminant_analysis.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update linear_discriminant_analysis.py * Update linear_discriminant_analysis.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update linear_discriminant_analysis.py * Update machine_learning/linear_discriminant_analysis.py Co-authored-by: Christian Clauss <[email protected]> * Update linear_discriminant_analysis.py * updated --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Christian Clauss <[email protected]>
1 parent 1158294 commit bf30b18

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

Diff for: ciphers/rsa_cipher.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,11 @@ def encrypt_and_write_to_file(
7676
key_size, n, e = read_key_file(key_filename)
7777
if key_size < block_size * 8:
7878
sys.exit(
79-
"ERROR: Block size is %s bits and key size is %s bits. The RSA cipher "
79+
"ERROR: Block size is {} bits and key size is {} bits. The RSA cipher "
8080
"requires the block size to be equal to or greater than the key size. "
81-
"Either decrease the block size or use different keys."
82-
% (block_size * 8, key_size)
81+
"Either decrease the block size or use different keys.".format(
82+
block_size * 8, key_size
83+
)
8384
)
8485

8586
encrypted_blocks = [str(i) for i in encrypt_message(message, (n, e), block_size)]
@@ -101,10 +102,11 @@ def read_from_file_and_decrypt(message_filename: str, key_filename: str) -> str:
101102

102103
if key_size < block_size * 8:
103104
sys.exit(
104-
"ERROR: Block size is %s bits and key size is %s bits. The RSA cipher "
105+
"ERROR: Block size is {} bits and key size is {} bits. The RSA cipher "
105106
"requires the block size to be equal to or greater than the key size. "
106-
"Did you specify the correct key file and encrypted file?"
107-
% (block_size * 8, key_size)
107+
"Did you specify the correct key file and encrypted file?".format(
108+
block_size * 8, key_size
109+
)
108110
)
109111

110112
encrypted_blocks = []

Diff for: machine_learning/linear_discriminant_analysis.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ def main():
399399
if input("Press any key to restart or 'q' for quit: ").strip().lower() == "q":
400400
print("\n" + "GoodBye!".center(100, "-") + "\n")
401401
break
402-
system("cls" if name == "nt" else "clear")
402+
system("clear" if name == "posix" else "cls") # noqa: S605
403403

404404

405405
if __name__ == "__main__":

0 commit comments

Comments
 (0)