Long list of latin phrases

Assignment Help Basic Computer Science
Reference no: EM131966135

Please help with the following programming problem(using python 3)

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.

 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: EM131966135

Questions Cloud

How do the protagonists in the texts being discussed : How do the protagonists in the texts being discussed similarly or differently position themselves with respect to their attitudes towards conventional views?
What are the key facts for jackson automotive systems : Jackson Automotive Systems produces automotive parts for advanced heating and air conditioning systems, engine cooling systems.
Describe the character of stevens : Describe the character of Stevens. What are his key characteristics and how do these characteristics inform the action of the story?
The inventory turnover ratio is measured : The inventory turnover ratio is measured as. If a firm bases its growth projection on the rate of sustainable growth, and shows positive net income, then the.
Long list of latin phrases : A Ceasar cipher is based on simply shifting the letters in the alphabet by a fixed amount. For example we might do the following:
Which portfolio should all risk-averse investors prefer : If portfolio XY fund has 50% of its investment in X and the rest in Y, which portfolio should all risk-averse investors prefer?
Write a report on Topic Malware - Past Present and Future : Write a report on given topic. Topic: Malware: Past, Present and Future. You are required to provide a complete report of your research project
List and returns the perfect shuffle : Using python 3, design a function perfect_shuffle(a_list) which takes as argument a list and returns the perfect shuffle of the list. The function
What kinds of duties do the managers of a corporation owe : What kinds of duties do the managers of a corporation owe, and to whom do they owe the duties you have identified?

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