Python ascii()

ASCII – American Standard Code for Information Interchange

The ascii() function returns a string containing a printable representation of an object and escapes the non-ASCII characters in the string using \x, \u or \U escapes.


object - String , List , tuple etc.


list = ['P¥thon' , 'µ', ' CodË it']

Output :

['P\xa5thon', '\xb5', ' Cod\xcb it']

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s