Menu

[Solved]-Question 14 Part Part B Part C Part D Python Q37235628

Question 14:

Part A:

Write a code block to encode strings into a secret message. Your code will presume a number, stored in key, and a message to

Part B:

Part C:

Part d:

In python

Write a code block to encode strings into a secret message. Your code will presume a number, stored in key, and a message to encode, as a string variable called message. Don’t define these variables in your code – they will be defined when you run the tests. To do so Initialize a variable called encoded as an empty string Use a for loop to loop across all characters of a string variable message Inside the loop, convert the character to another character: Get the unicode code point for the character (using ord) Add the value of key to that code point (which should be an int) o Convert this new int back to a character (using chr Also inside the loop, add this converted char to the string encoded In writefile A2Code/encoder.py # YOUR CODE HERE raise NotImplementedError In key 200 messagehello run-i/A2Code/encoder py assert isinstance (encoded, str) .İljjk’ assert encoded print(‘Original Message: t,message) print(‘Encoded Message: t’, encoded) We were unable to transcribe this imageWe were unable to transcribe this imageWe were unable to transcribe this imageShow transcribed image text Write a code block to encode strings into a secret message. Your code will presume a number, stored in key, and a message to encode, as a string variable called message. Don’t define these variables in your code – they will be defined when you run the tests. To do so Initialize a variable called encoded as an empty string Use a for loop to loop across all characters of a string variable message Inside the loop, convert the character to another character: Get the unicode code point for the character (using ord) Add the value of key to that code point (which should be an int) o Convert this new int back to a character (using chr Also inside the loop, add this converted char to the string encoded In writefile A2Code/encoder.py # YOUR CODE HERE raise NotImplementedError In key 200 messagehello run-i/A2Code/encoder py assert isinstance (encoded, str) .İljjk’ assert encoded print(‘Original Message: t,message) print(‘Encoded Message: t’, encoded)

Expert Answer


Answer to Question 14: Part A: Part B: Part C: Part d: In python… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *