Built-in Functions
ascii()
Return a printable representation using ASCII escape sequences.
ascii(object)
ascii() is like repr(), but it replaces non-ASCII characters with escape sequences. This can make text safe to display in ASCII-only places.
Arguments
Parameters
| Name | Description |
|---|---|
| object | Any object to represent as an ASCII-only string. |
Result
Returns
A string containing an ASCII-safe representation of the object.
Run it
Try it
Run it and change it
word = "café" print(ascii(word))
Output
Press Run to see what it prints.