Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def namesum_finder(name):
- namesum = 0
- for c in name:
- if str.isalpha(c):
- lettersum = ord(c)-64
- if lettersum <= 9:
- namesum += lettersum
- elif 9 < lettersum <= 18:
- namesum += (lettersum-9)
- elif 18 < lettersum <= 27:
- namesum += (lettersum-18)
- return namesum
- def reduced_namesum_finder(namesum):
- while namesum > 9 and not( namesum == 11 and namesum == 22):
- tens, ones = divmod(namesum, 10)
- namesum = tens+ones
- reduced_namesum = namesum
- return(reduced_namesum)
- while True:
- name = input("Please enter your name: ").upper()
- if name.replace(" ", "").isalpha():
- break
- else:
- print("That is not a valid name, try again:\n")
- namesum = namesum_finder(name)
- reduced_namesum = reduced_namesum_finder(namesum)
- print("Your personality number is:", reduced_namesum, "\n")
- 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"}
- print("Your personality associations are:", number_associations[reduced_namesum], sep="\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement