RosettaCodeData/Task/Character-codes/Python/character-codes-3.py

5 lines
169 B
Python
Raw Permalink Normal View History

2016-12-05 22:15:40 +01:00
print(ord('a')) # prints "97" (will also work in 2.x)
2013-04-10 16:57:12 -07:00
print(ord('π')) # prints "960"
2016-12-05 22:15:40 +01:00
print(chr(97)) # prints "a" (will also work in 2.x)
2013-04-10 16:57:12 -07:00
print(chr(960)) # prints "π"