Skip to content

Commit 8369bc0

Browse files
committed
study in unicode characters
1 parent 75ab1e3 commit 8369bc0

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

‎Work/unicode.py‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# In python 3 all strings are unicode.
2+
# We can enter not-easily-typable unicode chars in a variety of ways
3+
print('Using unicode chars in python')
4+
print('* Use slash-u followed by unicode number/code')
5+
print('\t', '\\u0101 =>', '\u0101')
6+
print('\t', 'S\\u0101dhakam =>', 'S\u0101dhakam')
7+
print('\t', '\\u00bd =>', '\u00bd')
8+
print('\t', 'or, \\xbd =>', '\xbd')
9+
print()
10+
print("* Use the charactor's name with \\N")
11+
print('\t', "\\N{TAMIL FRACTION ONE QUARTER} =>", "\N{TAMIL FRACTION ONE QUARTER}")
12+
print('\t', "\\N{VULGAR FRACTION ONE HALF} =>", "\N{VULGAR FRACTION ONE HALF}")
13+

0 commit comments

Comments
 (0)