diff --git a/ciphers/rsa_cipher.py b/ciphers/rsa_cipher.py
index de26992f5eeb..9c41cdc5d472 100644
--- a/ciphers/rsa_cipher.py
+++ b/ciphers/rsa_cipher.py
@@ -76,10 +76,11 @@ def encrypt_and_write_to_file(
     key_size, n, e = read_key_file(key_filename)
     if key_size < block_size * 8:
         sys.exit(
-            "ERROR: Block size is %s bits and key size is %s bits. The RSA cipher "
+            "ERROR: Block size is {} bits and key size is {} bits. The RSA cipher "
             "requires the block size to be equal to or greater than the key size. "
-            "Either decrease the block size or use different keys."
-            % (block_size * 8, key_size)
+            "Either decrease the block size or use different keys.".format(
+                block_size * 8, key_size
+            )
         )
 
     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:
 
     if key_size < block_size * 8:
         sys.exit(
-            "ERROR: Block size is %s bits and key size is %s bits. The RSA cipher "
+            "ERROR: Block size is {} bits and key size is {} bits. The RSA cipher "
             "requires the block size to be equal to or greater than the key size. "
-            "Did you specify the correct key file and encrypted file?"
-            % (block_size * 8, key_size)
+            "Did you specify the correct key file and encrypted file?".format(
+                block_size * 8, key_size
+            )
         )
 
     encrypted_blocks = []
diff --git a/machine_learning/linear_discriminant_analysis.py b/machine_learning/linear_discriminant_analysis.py
index f4fb5ba76b64..c0a477be10c7 100644
--- a/machine_learning/linear_discriminant_analysis.py
+++ b/machine_learning/linear_discriminant_analysis.py
@@ -399,7 +399,7 @@ def main():
         if input("Press any key to restart or 'q' for quit: ").strip().lower() == "q":
             print("\n" + "GoodBye!".center(100, "-") + "\n")
             break
-        system("cls" if name == "nt" else "clear")
+        system("clear" if name == "posix" else "cls")  # noqa: S605
 
 
 if __name__ == "__main__":