Skip to content

Commit 55dfc2c

Browse files
authored
Update main.py
Signed-off-by: de_soot <[email protected]>
1 parent f6147d5 commit 55dfc2c

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

main.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
user_input = input("\tPress enter to start encrypting messages using a modified Caesar's Cipher. Enter 'quit' to exit the program\n>>> ")
2-
3-
while user_input.lower() != "quit":
1+
def main() -> None:
2+
user_input = input("\tPress enter to start encrypting messages using a modified Caesar's Cipher. Enter 'quit' to exit the program\n>>> ").lower()
3+
4+
if user_input == "quit":
5+
return
6+
47
encryption_key = int(input("\tEnter encryption key\n>>> "))
58
message_original = str(input("\tEnter your message\n>>> "))
6-
9+
710
message_encrypted = ""
811

912
for char in message_original:
@@ -32,6 +35,8 @@
3235
message_encrypted += chr(char_unicode_new)
3336

3437
print("Encrypted message : " + message_encrypted)
35-
36-
user_input = input("\tPress enter to continue encrypting messages. Enter 'quit' to exit the program\n>>> ")
3738

39+
main()
40+
41+
if __name__ == __main__:
42+
main()

0 commit comments

Comments
 (0)