Question

Q16-Decoder (0.5 points) Write a code block to decode strings from secret encodings back to readable messages. To do so: Init

0 0
Add a comment Improve this question Transcribed image text
Answer #1

CODE:

encoded = "İĭĴĴķ"
key = 200

# BELOW IS  THE CODE FOR DECODING THE STRING
decoded = ""
for i in encoded: # Traversing over encoded string
    unicode = ord(i) # Getting the unicode of the chracter
    decoded += chr(unicode-key) # Subtracting key and converting back to character
    
print("Encoded Message: \t",encoded)
print("Decoded Message: \t",decoded)

OUTPUT:

encodedIijjk key-20e # BELOW IS THE CODE FOR DECODING THE STRING decoded for i in encoded: # Traversing over encoded str

Add a comment
Know the answer?
Add Answer to:
Q16-Decoder (0.5 points) Write a code block to decode strings from secret encodings back to reada...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • For this assignment, you will write a program to work with Huffman encoding. Huffman code is...

    For this assignment, you will write a program to work with Huffman encoding. Huffman code is an optimal prefix code, which means no code is the prefix of another code. Most of the code is included. You will need to extend the code to complete three additional methods. In particular, code to actually build the Huffman tree is provided. It uses a data file containing the frequency of occurrence of characters. You will write the following three methods in the...

  • C++ please Programming Assignment #6 Help Me Find The Secret Message Description: This assignment will require...

    C++ please Programming Assignment #6 Help Me Find The Secret Message Description: This assignment will require that you read in an encrypted message from a file, decode the message, and then output the message to a file. The encryption method being used on the file is called a shift cipher (Info Here). I will provide you with a sample encrypted message, the offset, and the decrypted message for testing. For this project I will provide you main.cpp, ShiftCipher.h, and ShiftCipher.cpp....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT