0

Converting ASCII values back to words with python

6th Apr 2024, 8:33 PM
Sbusiso Ndunge
Sbusiso Ndunge - avatar
3 Respuestas
+ 6
chr() function may be what you need, but you should explain better what you are trying to, possibly attach your code.
6th Apr 2024, 8:40 PM
Tibor Santa
Tibor Santa - avatar
+ 1
Thank you for the snippet, I'll kindly do so
11th Apr 2024, 11:26 AM
Sbusiso Ndunge
Sbusiso Ndunge - avatar
0
Here is an example Python code that converts ASCII values back to words I attached below. Mentor sir already mentioned before. I just help you to give you a snippet. When you run this code, it will output: ``` Hello World ``` The code uses a list comprehension to convert each ASCII value in the list `ascii_values` to its corresponding character using the `chr()` function. The `chr()` function takes an ASCII value and returns the character corresponding to that value. Then `" ".join()` function is used to join all the characters together to form a single string and assigned to the variable `word`. Finally, the code prints out the `word`, which represents the string "Hello World" by converting the ASCII values back to characters and joining them together. https://sololearn.com/compiler-playground/cLPG5gHFHzXF/?ref=app
10th Apr 2024, 8:57 PM
`ᴴᵗᵗየ
`ᴴᵗᵗየ - avatar