Skip to content

Commit bfe41f9

Browse files
committed
Enhanced the the user-interaction menu
1 parent 5c30e00 commit bfe41f9

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

ciphers/caesar_cipher.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -272,12 +272,9 @@ def brute_force(input_string: str, alphabet: str | None = None) -> dict[int, str
272272
banner = pyfiglet.figlet_format("Caesar Cipher", font="big")
273273
print(banner)
274274
while True:
275-
banner = pyfiglet.figlet_format("Caesar Ciphar", font="big")
276-
print(banner)
277275
print(f"\n{'-' * 10}\n Menu\n{'-' * 10}")
278276
print("Please select from the following options: ")
279-
print(
280-
*[
277+
print(*[
281278
"1.Encrypt",
282279
"2.Encrypt a File",
283280
"3.Decrypt",
@@ -289,10 +286,10 @@ def brute_force(input_string: str, alphabet: str | None = None) -> dict[int, str
289286
)
290287

291288
# get user input
292-
choice = input("\nWhat would you like to do?: ").strip() or "4"
289+
choice = input("\nWhat would you like to do?: ").strip() or "6"
293290

294291
# run functions based on what the user chose
295-
if choice not in ("1", "2", "3", "4"):
292+
if choice not in ("1", "2", "3", "4", "5", "6"):
296293
print("Invalid choice, please enter a valid choice")
297294
elif choice == "1":
298295
input_string = input("Please enter the string to be encrypted: ")

0 commit comments

Comments
 (0)