Simply shifting the letters in the alphabet by a fixed

Assignment Help Basic Computer Science
Reference no: EM131979211

Please help with the following programming using python 3

Ceasar cipher

A Ceasar cipher is based on simply shifting the letters in the alphabet by a fixed amount. For example we might do the following:

    Plain:     ABCDEFGHIJKLMNOPQRSTUVWXYZ
    Cipher:    DEFGHIJKLMNOPQRSTUVWXYZABC

So each 'A' in the message is replaced by a 'D', each 'M' by a 'P', and so on. That is, there is a shift of 3 letters. Note that the alphabet wraps around at the end: An 'X' (third from the end) is replaced by an 'A', etc. a function that takes two arguments, a string to encrypt and a shift value (an integer) to use for encrypting it, and returns the encrypted string. Apply the same shift to both lower and upper case letters. Do not alter the non-alphabetical characters (like space, comma etc).

Design a function that takes two arguments, a string to encrypt and a shift value (an integer) to use for encrypting it, and returns the encrypted string. Apply the same shift to both lower and upper case letters. Do not alter the non-alphabetical characters (like space, comma etc).

Examples:

  • Encrypting "Et tu, Brutus!" with a shift of 3 should return "Hw wx, Euxwxv!".
  • (Wikipedia has a long list of Latin phrases if you want to encrypt more examples in Latin.)
  • Encrypting "IBM" with a shift of -1 should return "HAL".

To decrypt a string, you can call the same function with the negative of the shift that was used to encrypt it. Also note that the function is invariant of the shift modulo 26: that is, a shift of 29 is the same as a shift of 3 (3 == 29 % 26), and a shift of -1 is the same as a shift of 25 (25 == -1 % 26).

Reference no: EM131979211

Questions Cloud

Generate patient specific ehr guidelines : List three components the EHR can employ to generate patient specific EHR guidelines? Describe the importance of each component in detail?
Prepare cash receipts schedule : Prepare a Cash Receipts Schedule-Schedule the months of Sept, Oct, Nov and December
Improve production and decides to deploy training program : ABC Company needs to improve production and decides to deploy a training program.
How should hr act as a strategic partner : How should HR act as a strategic partner? What attributes are necessary to be a HR strategic partner?
Simply shifting the letters in the alphabet by a fixed : A Ceasar cipher is based on simply shifting the letters in the alphabet by a fixed amount. For example we might do the following:
What are some key hr concerns in taking organization global : What are some key HR concerns or issues in taking an organization global? The response must be typed.
Recovery period for residential rental property each year : How much will he be able to depreciate using the class recovery period for residential rental property each year?
Several properties of user-defined functions : Determinism of a function is one of several properties of user-defined functions that determine the ability of SQL to index results.
Justify ideas with support from the topic materials : Justify your ideas with support from the Topic Materials or relevant industry examples.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd