Function chr (Example Python Built-in Functions)

Comments   0   Date Arrow  November 6, 2008 at 9:37am   User  by pichai

chr(i)
คืนตัวอักษรที่มีค่า ACSII เท่ากับ i ซึ่งจะตรงข้ามกับฟังก์ชั่น ord() โดยจะรับค่าตัวเลข 0 ถึง 255 นอกเหนือจากนั้นจะเกิดข้อผิดพลาด
>>> chr(97)
‘a’
>>> chr(122)
‘z’

Tagged   Talk  delicious  Comments  Add Your Comment