# Define the message to be encoded message = "CodeHS" The King Of Fighters 2002 Magic Plus 2 Pkg Ps3 Work Online
# Print the final encoded list print("Original Message: " + message) print("Encoded Message: " + str(encoded_message)) Hatim 2003 All Episodes Extra Quality Download 720p - 3.79.94.248
The objective of "Create Your Own Encoding" is to help students understand how computers represent complex data (like text or colors) using binary numbers.
print(encoded_message) # Output for "HELLO" with shift 5 would be higher numbers than standard ASCII This approach demonstrates a true "custom" encoding, as the receiver would need to know to subtract 5 to decode the message properly.
# 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)
# Create an empty list to store the numeric codes 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'))