Teaching Kids Programming: Videos on Data Structures and Algorithms
ASCII = American Standard Code for Information Interchange. Basically it is a charset that maps the keys to code (integers).
ASCII Print-able Characters
32 (Space) to 126
ASCII Non Printerable Characters
1 to 31, and 127 (DEL)
Print ASCII Code
for i in range(1, 128):
print(chr(i), ord(chr(i))
The chr() function returns ASCII character. And the ord() returns its ASCII for a given character
lower and upper conversion
'A'.lower() # 'a'
'a'.upper() # 'A'
Re-invent the lower/upper function
def lower(c):
if c >= 'A' and c <= 'Z':
return chr(ord(c) + 32)
return c
def upper(c):
if c >= 'a' and c <= 'z':
return chr(ord(c) - 32)
return c
–EOF (The Ultimate Computing & Technology Blog) —
247 wordsLast Post: Compute the Inorder Successor of a Binary Tree
Next Post: Recursive Algorithm to Cut a Binary Search Tree (Remove Nodes Not In Range)