Advertisement
here2share

# str_alpha_val_from_zero.py

Apr 10th, 2015
357
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. # str_alpha_val_from_zero.py
  2.  
  3. ABC_String = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  4. ABC_String += ABC_String.lower()
  5. for abc in  ABC_String:
  6.     ASC2_val=ord(abc[0])
  7.     if ASC2_val > 64 and ASC2_val < 91: # Uppercase
  8.         gen_val=ord(abc[0])-65
  9.     elif ASC2_val > 96 and ASC2_val < 123:
  10.         gen_val=ord(abc[0])-71
  11.     print abc,'=',gen_val
  12.    
  13. print 'Done'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement