224k views
1 vote
How to convert ASCII value into string?

1 Answer

7 votes

Final answer:

To convert an ASCII value into a string in Python, use the chr () function.

Step-by-step explanation:

To convert an ASCII value into a string in Python, you can use the built-in 'chr ()' function. The 'chr ()' function takes an integer argument, which is the ASCII value, and returns the corresponding character as a string.

Here's an example:

# ASCII value of 'A' is 65

ascii_value = 65

character = chr (ascii_value)

print(character) # Output: 'A'

In this example, the ASCII value of 'A' is 65. Using the 'chr ()' function, we convert the ASCII value into the corresponding character, which is 'A'.

User Aqueelah
by
7.6k points