The ascii() function is used to get the ASCII representation of a given object. It is a versatile tool for representing data and objects in their most basic form, without any additional formatting.

The  function takes one argument i.e the object whose ASCII representation we want. The object can be of any type such as a number, a string, a list, custom objects, etc. 

Syntax:

ascii(obj)

Examples:

ascii(1)
//'1'
ascii('Hello')
//"'Hello'"
ascii([1, 2, 3, 4])
//'[1, 2, 3, 4]'
ascii({'foo': 'bar'})
//"{'foo': 'bar'}"
ascii(print)
//'<built-in function print>'
ascii('ß')
//"'\\xdf'"
ascii('🙂')
//"'\\U0001f642'"