Answered step by step
Verified Expert Solution
Question
1 Approved Answer
python For this assignment you will upload an original Python script that satisfies the following specifications: the script should contain a function called caesar o
python
For this assignment you will upload an original Python script that satisfies the following specifications: the script should contain a function called caesar o the function should take two arguments, in the following order: a string to be encrypted the amount by which to shift the alphabet (should be an integer; may be positive, negative, or zero) a shift of 1 means that "a" in the source text should become "b" in the encrypted text a shift of 0 means that "a" in the source text should remain "a" in the encrypted text " a shift of-1 means that "a" in the source text should become-z" in the encrypted text o the function should replace all lower-case English alphabet letters in the provided string (the first argument) according to the shift specified by the second argument o the function should preserve all other characters (upper-case letters, punctuation, letters with diacritics, letters in other scripts, etc.) o the function should return the encoded string the script should take two command line arguments, in the following order: o a string to be encrypted o the amount by which to shift the alphabet, following the same conventions as specified for the second argument to the caesar function the script should call the caesar function using the command-line arguments and print the result of the function to the console (i.e., stdout) in addition to Python's built-in functionality, you are allowed to use the following Python packages: argparse, sys. All other Python packages are disallowed for this assignment. (Use of argparse is totally optional.) the script should adhere to the Style guide a sting to be encrypted the amount by which to shift the alphabet, following the same conventions as specified for the second argument to the caesar function function to the console (i.e., stdout) argparse, sys. All other Python packages are disallowed for this assignment. (Use of argparse is totally the script should call the caesar function using the command-line arguments and print the result of the in addition to Python's built-in functionality, you are allowed to use the following Python packages: optional.) the script should adhere to the Style guide Hints I suggest you loop over the source string and build up a new string one character at a time. You may want to create a string containing all the lower-case letters of the English alphabet, in order The in operator is your friend The find) method of strings is your friend. * The % operator (modulo) is your friend. Tests String to encrypt abcde How quickly daft jumping zebras Shift String that should be returned abcde Hyg aesmuvi nkpd tewzsxq jolbkc foh. Mr xq inu jnbs vkhpw ztox chryne matgdl 10 vex. My ex pub quiz crowd gave joyful thanks Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started