Python ascii() function
Published February 17, 2022ASCII is a character encoding system that represents English characters with integers ranging from 0 to 127.
In Python, the ascii() function provides a string holding a printable representation of objects, including non-alphabet or invisible characters such as carriage, tab, form feed, and so on. It uses the x, u, or U escapes to escape non-ASCII characters in the string.
The syntax of the ascii() function
The ascii() function is implemented as follows
ascii(object) |
The method only accepts one argument, which may be a string, list, dictionary, or any other.
Example
a = '''I |
Output
With ascii function : 'I\nLove\nPython' |
Article Contributed By :
|
|
|
|
266 Views |