The syntax of ascii() is:
The ascii() method takes an object (like: strings, list etc).
It returns a string containing printable representation of an object.
For example, ö is changed to \xf6n, √ is changed to \u221a
The non-ASCII characters in the string is escaped using \x, \u or \U.
normalText = 'Python is interesting'
otherText = 'Pythön is interesting'
print('Pyth\xf6n is interesting')
When you run the program, the output will be:
'Python is interesting'
'Pyth\xf6n is interesting'
Pythön is interesting
randomList = ['Python', 'Pythön', 5]
['Python', 'Pyth\xf6n', 5]