#🔒 Python Homework exercise. Manipulating Strings (Coding and Decoding)

15 messages · Page 1 of 1 (latest)

fathom jetty
#

Exercise: A method for encoding/decoding a text is based on the idea of
replace a character with the character that is a certain distance away from it.
For example, if the chosen distance is 2, then c replaces a, d
replaces b and so on. Write a program to encode
and another to decode using this method. The distance must be
a parameter of the problem and can be positive or negative. Think about how it goes
solve the case of characters at the ends of the alphabet.

warm rainBOT
#

@fathom jetty

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

fathom jetty
#

i dont know even where to stard

#

start

ashen dune
#

this is just a ceasar encryption

#

split it into small pieces and then start

worldly scaffold
#

In cryptography, a Caesar cipher, also known as Caesar's cipher, the shift cipher, Caesar's code, or Caesar shift, is one of the simplest and most widely known encryption techniques. It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter some fixed number of positions down the alphabet. For example, wit...

fathom jetty
#

so its easier if i convert all strings to numbers

#

and then add and subtract them depending of the input

worldly scaffold
#

!e

print(ord('a'), ord('b'))
warm rainBOT
fathom jetty
#

and then convert again

worldly scaffold
#

And chr is the opposite of ord.

warm rainBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.