1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Daniel [21]
3 years ago
15

Write a script that inputs a line of plaintext and a distance value and outputs an encrypted text using a Caesar cipher.

Computers and Technology
1 answer:
belka [17]3 years ago
7 0

Answer:

def encrypt_text(text,value):

   encoded = ""

   for i in range(len(text)):

       char = text[i]

       if (char.isupper()):

           encoded += chr"po"ord'po'char'pc' + value -65'pc' % 26 + 65'pc'

       else:

           encoded += chr'po'ord'po'char'pc' + value -97'pc' % 26 + 97'pc'

   return encoded

plaintext = input("Enter sentence of encrypt: ")

dist_value = int(input("Enter number: "))

encrypted = encrypt_text(plaintext, dist_value)

print(encrypted)

Explanation:

The python program above is a Ceasar cipher implementation. The encrypt_text function is defined to accept text input and a distance value, which is used to encrypt the plaintext.

The user can directly input text and the distance value from the prompt and get the encrypted text printed on the screen.

You might be interested in
_____ use patterns to find solutions instead of using the if-then-else rules that expert systems use.
iren2701 [21]

Based on networking systems operations, <u>Artificial neural networks</u> use patterns to find solutions instead of using the if-then-else rules that expert systems use.

<u>Artificial neural networks</u> are computing systems designed to work like human or animal neural networks.

The <u>artificial neural network</u> generally has connected nodes that function as the biological brain.

<u>Artificial Neural Networks</u> is generally used for the following:

  • Intricate patterns,
  • Prediction problems,
  • Algorithm development, etc.

Hence, in this case, it is concluded that the correct answer is "<u>Artificial neural networks."</u>

Learn more about Artificial neural networks here: brainly.com/question/23824028

5 0
2 years ago
Click _______ to add a new column to a table.
Sophie [7]
The answer is Insert control B

5 0
4 years ago
Read 2 more answers
There are many opportunities for unscrupulous people to break information system security. Of the five components in an informat
7nadin3 [17]

The answer is letter e.

People is the component poses the very large ongoing security risk. It also can be a threat to the safety. People play an essential part in most operational systems and methods. Information, ability and mental outlook often determine the feature and quantity of system output. Just as a stereo requires the right component, high-performance business systems require the right fit of people to work.


8 0
3 years ago
Read 2 more answers
You are flying an aircraft equipped with an electronic flight display and the air data computer fails. What instrument is affect
Makovka662 [10]

Answer:

cause loss of power, excessive oil consumption, and possible permanent internal engine damage.

Explanation:

4 0
3 years ago
Which of the following is the result of a query?
IgorLugansk [536]
I think the answer is A
6 0
3 years ago
Other questions:
  • What inventor patented the first America movie projector
    13·2 answers
  • Which loan type requires you to make loan payments while you’re attending school?
    7·1 answer
  • ) write a program that creates a vector of string called "vec". vector "vec" grows and shrinks as the user processes the transac
    6·1 answer
  • Write a program that prompts the user for an integer and then prints all prime numbers up to that integer.
    7·1 answer
  • True or false there is no relationship between the purpose of the page and the page quality
    13·1 answer
  • There are four types of characteristics attributed to a flow: reliability, delay, jitter, and bandwidth. Explain how each of the
    8·1 answer
  • How do you make computers or microwaves?
    13·1 answer
  • If you are to enhance the ICT used by your teachers, how will ypu do it? Will you use the same ICT or will you modify how it was
    11·1 answer
  • The project team is creating detailed documents to guide the team. What phase of the project life cycle are they in?
    6·1 answer
  • You need to design an online login form in which users have to type their name and password to log into an application. The pass
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!