ascii()

ascii() to return printable chars

Example : ( with output after comment # )
print(ascii('Ù')) # '\xd9'
print(ascii('å')) # '\xe5'
print(ascii('õ')) # '\xf5'
print(ascii('÷')) # '\xf7'
Using string
print(ascii('þlûs2ñet'))
Output
'\xfel\xfbs2\xf1et'
Using List
my_list=['Oñe','Twö','Threë']
print(ascii(my_list))
Output
['O\xf1e', 'Tw\xf6', 'Thre\xeb']
Using for loop to display Unicode point value with equivalend char and printable char
for i in range(200,250):
    print(i,":",chr(i),ascii(chr(i)))
All Built in Functions in Python chr() ord()


plus2net.com



Post your comments , suggestion , error , requirements etc here




We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2020 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer