Advertisement
Guest User

Untitled

a guest
Oct 21st, 2014
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.48 KB | None | 0 0
  1. # How to Calculate Your Name Number in Numerology
  2. # Min Kim
  3. # 2014.10.21
  4.  
  5. name = input("Full Name: ")
  6.  
  7.  
  8. l = len(name)
  9. sum = 0
  10. i = 0
  11. j = 0
  12. n = 0
  13. c = 0
  14.  
  15. namenumber = []
  16.  
  17. for i in range(0,l):
  18.     tmp = 0
  19.     c = name[i].upper()
  20.     if (ord(c)>= 65 and ord(c) <= 73):
  21.        tmp = ord(c) - 64
  22.     elif (ord(c)>= 74 and ord(c) <= 82):
  23.        tmp = ord(c) - 73
  24.     elif (ord(c)>= 83 and ord(c) <= 90):
  25.        tmp = ord(c) - 82
  26.     sum = sum + tmp
  27.     namenumber.append(tmp)
  28.  
  29. print ("\nName:  ",name)                    
  30. print ('Number: ', end ="")
  31. for i in namenumber:
  32.     if i == 0:
  33.        print(" ", end = "")
  34.     else:
  35.        print(i, end = "")
  36.            
  37. print ('\n\nTotal Name Number: ', sum)
  38.  
  39. sumstr = str(sum)
  40. ll = len(sumstr)
  41.  
  42. for j in range(0,ll):
  43.     n = n + int(sumstr[j])
  44. m = str(n)
  45. f_sum = 0
  46.  
  47. if  (n < 10 or n == 11 or n == 22):
  48.      f_sum = n
  49. else:
  50.      for lm in range(0,len(m)):
  51.          f_sum = f_sum + int(m[lm])
  52.  
  53. print ()
  54. print ('Name Number: ',f_sum)
  55.  
  56. print ()
  57. print ('Associations: ', end="")
  58.  
  59. if (f_sum == 1):
  60.    ass = ("Initiating Action,Pioneering,Leading,Independant,Attaining,Individual")
  61. elif (f_sum == 2):
  62.    ass = ("Cooperation,Adaptability,Consideration of others,Partnering,Mediating")
  63. elif (f_sum == 3):
  64.    ass = ("Expression,Verbalization,Socialization,The Arts,The Joy of Living")
  65. elif (f_sum == 4):
  66.    ass = ("A Foundation,Order,Service,Struggle against limits,Steady Growth")
  67. elif (f_sum == 5):
  68.    ass = ("Expansiveness,Visionary,Adventure,The constructive use of freedom")
  69. elif (f_sum == 6):
  70.    ass = ("Responsibility,Protection,Nurturing,Community,Balance,Sympathy")
  71. elif (f_sum == 7):
  72.    ass = ("Analysis,Understanding,Knowledge,Awareness,Studious,Meditating")
  73. if (f_sum == 8):
  74.    ass = ("Practical endeavors,Status oriented,Power-seeking,High-material goals")
  75. elif (f_sum == 9):
  76.    ass = ("Humanitarian,Giving nature,Selflessness,Obligations,Creative expression")
  77. elif (f_sum == 11):
  78.    ass = ("Higher spiritual plane,Intuitive,Illumination,Idealist,A dreamer")
  79. elif (f_sum == 22):
  80.    ass = ("The Master Builder,Large endeavors,Powerful force,Leadership")
  81.  
  82. ass = ass + ','
  83. ass_lst = []
  84. s = 0
  85.  
  86. for i in range(len(ass)):
  87.     if ass[i] == ',':
  88.        ass_lst.append(ass[s:i])
  89.        s = i+1
  90.  
  91. ass_lst.sort(key=len)
  92.  
  93. for i in range (len(ass_lst)):
  94.     if i > 0:
  95.        print (' '*14, end = "")
  96.     print(ass_lst[i].center(len(ass_lst[-1])))
  97.  
  98. input ("\nPlease Enter to Exit")
  99. #END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement