File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Code-Sleep-Python/Caesar-cipher Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 11import string
2- string . ascii_lowercase
2+ import argparse
33
4+ string .ascii_lowercase
45# We will consider the alphabet to be these letters, along with a space.
56
67# create `letters` here!
78
8-
9-
10- ##
119alphabet = string .ascii_lowercase + " "
1210letters = dict (enumerate (alphabet ))
1311
14- # define `coded_message` here!
15-
12+ p = argparse .ArgumentParser (description = "Implement Caesar Cipher Algorithm" )
13+ p .add_argument ("-e" , "-encription_key" , help = "encription key" )
14+ p .add_argument ("-m" , "-message" , help = "message" )
15+ args = p .parse_args ()
1616
1717
1818##################
1919
20- message = raw_input ( "Enter a string: " )
20+ message = args . m
2121
2222def caesar (mee , encryption_key ):
2323
@@ -45,7 +45,7 @@ def caesar(mee, encryption_key):
4545 return encoded_mess
4646
4747
48- encryption_key = input ( "Enter a number: " )
48+ encryption_key = args . e
4949
5050encoded_message = (caesar (message ,encryption_key ))
5151print (encoded_message )
You can’t perform that action at this time.
0 commit comments