83 8 Create Your Own Encoding Codehs Answers Exclusive -
Asking for help is not cheating. The difference lies in how you use external resources. Legitimate help includes:
Crossing the line involves: copying code from a GitHub repository labeled “CodeHS 8.3 answers,” paying someone to write the functions for you, or submitting work that you cannot explain line-by-line. 83 8 create your own encoding codehs answers exclusive
function decode83_8(encoded):
alphabet = [list of 83 symbols]
blockSize = 8
padding = '~'
output = ""
for i from 0 to len(encoded) step blockSize:
block = encoded[i : i+blockSize]
for ch in block:
if ch == padding:
continue
output += ch
return output
If using numeric block values:
for each numeric value:
digits = []
for k from 1 to blockSize:
digit = value % 83
value = value // 83
digits.prepend(alphabet[digit])
append digits to output, ignoring padding
Here is a clean, working solution that fulfills the standard requirements for 8.3.8. Asking for help is not cheating
# Define the message to be encoded
message = "CodeHS"
# Create an empty list to store the numeric codes
encoded_message = []
# Loop through each character in the message
for character in message:
# Convert the character to its ASCII number value
number_value = ord(character)
# Add the number to our list
encoded_message.append(number_value)
# Print the final encoded list
print("Original Message: " + message)
print("Encoded Message: " + str(encoded_message))
# --- BONUS: Converting to Binary ---
# If the assignment requires binary output as well:
binary_list = []
for num in encoded_message:
# format(num, 'b') converts the number to binary string
binary_list.append(format(num, 'b'))
print("Binary Encoding: " + str(binary_list))