Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. def namesum_finder(name):
  2. namesum = 0
  3. for c in name:
  4. if str.isalpha(c):
  5. lettersum = ord(c)-64
  6. if lettersum <= 9:
  7. namesum += lettersum
  8. elif 9 < lettersum <= 18:
  9. namesum += (lettersum-9)
  10. elif 18 < lettersum <= 27:
  11. namesum += (lettersum-18)
  12.  
  13. return namesum
  14.  
  15. def reduced_namesum_finder(namesum):
  16. while namesum > 9 and not( namesum == 11 and namesum == 22):
  17. tens, ones = divmod(namesum, 10)
  18. namesum = tens+ones
  19. reduced_namesum = namesum
  20. return(reduced_namesum)
  21.  
  22. while True:
  23. name = input("Please enter your name: ").upper()
  24. if name.replace(" ", "").isalpha():
  25. break
  26. else:
  27. print("That is not a valid name, try again:\n")
  28.  
  29. namesum = namesum_finder(name)
  30. reduced_namesum = reduced_namesum_finder(namesum)
  31.  
  32. print("Your personality number is:", reduced_namesum, "\n")
  33. number_associations = {1: "Initiating action, pioneering, leading, independent, attaining, individual", 2: "cooperation, adaptability, consideration of others, partnering, mediating", 3: "expression, verbalization, socialization, the arts, the joy of living", 4: "a foundation, order, service, struggle against limits, steady growth", 5: "expansiveness, visionary, adventure, the constructive use of freedom", 6: "responsibility, protection, nurturing, community, balance, sympathy", 7:"analysis, understanding, knowledge, awareness, studious, meditating", 8: "practical endeavors, status oriented, power seeking, material goals", 9: "humanitarian, giving nature, selflessness, obligations, creative expression", 11:"higher spiritual plane, intuitive, illumination, idealist, a dreamer", 22:"the Master Builder, large endeavors, powerful force, leadership"}
  34. print("Your personality associations are:", number_associations[reduced_namesum], sep="\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement