Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Intro, defining and importing things + intro paragraph
- import string
- allChars = string.ascii_lowercase + string.ascii_uppercase + " " + "-"
- validChars = list(allChars)
- nameAuth = False
- print("Yada yada.")
- #Validation of the user's name, with the retrieving embedded
- while nameAuth == False:
- nameLock = 0
- userName = input("Please enter your full name, using only the standard Latin alphabet, hyphens for double-barrelled names, and spaces. If your name contains accented letters, please replace them with the unaccented variants of the letters.")
- userList = list(userName)
- for letterCount in userList:
- arrayCount = 0
- while arrayCount <= 53:
- if letterCount == validChars[arrayCount]:
- nameLock = nameLock + 1
- arrayCount = arrayCount + 1
- if nameLock == len(userName):
- nameAuth = True
- else:
- print("Sorry, you seem to have inputted invalid characters.")
- #Part 2
- totalSum = 0
- for letterCount in userList:
- wbVal = " "
- if ord(letterCount) != 45 and ord(letterCount) != 32:
- if ord(letterCount) > 90:
- wbVal = ord(letterCount) - 96
- else:
- wbVal = ord(letterCount) - 64
- wbVal2 = wbVal % 9
- if wbVal2 == 0:
- totalSum = totalSum + 9
- else:
- totalSum = totalSum + wbVal2
- #Total 3
- while totalSum > 9:
- finalList = list(str(totalSum))
- finalNumber = 0
- for wbVal3 in finalList:
- finalNumber = finalNumber + int(wbVal3)
- totalSum = finalNumber
- #Final output statement
- if finalNumber == 1:
- numberMeaning = "a natural leader."
- if finalNumber == 2:
- numberMeaning = "a natural peacemaker."
- if finalNumber == 3:
- numberMeaning = "a creative and optimistic individual."
- if finalNumber == 4:
- numberMeaning = "a dilligent, hard-working individual."
- if finalNumber == 5:
- numberMeaning = "an individual that values their freedom."
- if finalNumber == 6:
- numberMeaning = "a caring individual that provides for their loved ones."
- if finalNumber == 7:
- numberMeaning = "an individual that likes to dwell and think on the problems they face."
- if finalNumber == 8:
- numberMeaning = "an individual that often exercises their diplomatic skills."
- if finalNumber == 9:
- numberMeaning = "a selfless, generous individual, never afraid to give to those around them."
- print("Your name is " + userName + ", and your lucky number is " + str(finalNumber) + ". Your number shows that you are " + numberMeaning)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement