Advertisement
Guest User

KAMILS FINISHED CODE WOLOLOLOLOLO

a guest
Feb 19th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. #Intro, defining and importing things + intro paragraph
  2.  
  3. import string
  4.  
  5. allChars = string.ascii_lowercase + string.ascii_uppercase + " " + "-"
  6. validChars = list(allChars)
  7. nameAuth = False
  8.  
  9. print("Yada yada.")
  10.  
  11. #Validation of the user's name, with the retrieving embedded
  12.  
  13. while nameAuth == False:
  14. nameLock = 0
  15. 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.")
  16. userList = list(userName)
  17. for letterCount in userList:
  18. arrayCount = 0
  19. while arrayCount <= 53:
  20. if letterCount == validChars[arrayCount]:
  21. nameLock = nameLock + 1
  22. arrayCount = arrayCount + 1
  23. if nameLock == len(userName):
  24. nameAuth = True
  25. else:
  26. print("Sorry, you seem to have inputted invalid characters.")
  27.  
  28. #Part 2
  29.  
  30. totalSum = 0
  31.  
  32. for letterCount in userList:
  33. wbVal = " "
  34. if ord(letterCount) != 45 and ord(letterCount) != 32:
  35. if ord(letterCount) > 90:
  36. wbVal = ord(letterCount) - 96
  37. else:
  38. wbVal = ord(letterCount) - 64
  39. wbVal2 = wbVal % 9
  40. if wbVal2 == 0:
  41. totalSum = totalSum + 9
  42. else:
  43. totalSum = totalSum + wbVal2
  44.  
  45. #Total 3
  46.  
  47. while totalSum > 9:
  48. finalList = list(str(totalSum))
  49. finalNumber = 0
  50. for wbVal3 in finalList:
  51. finalNumber = finalNumber + int(wbVal3)
  52. totalSum = finalNumber
  53.  
  54. #Final output statement
  55.  
  56. if finalNumber == 1:
  57. numberMeaning = "a natural leader."
  58. if finalNumber == 2:
  59. numberMeaning = "a natural peacemaker."
  60. if finalNumber == 3:
  61. numberMeaning = "a creative and optimistic individual."
  62. if finalNumber == 4:
  63. numberMeaning = "a dilligent, hard-working individual."
  64. if finalNumber == 5:
  65. numberMeaning = "an individual that values their freedom."
  66. if finalNumber == 6:
  67. numberMeaning = "a caring individual that provides for their loved ones."
  68. if finalNumber == 7:
  69. numberMeaning = "an individual that likes to dwell and think on the problems they face."
  70. if finalNumber == 8:
  71. numberMeaning = "an individual that often exercises their diplomatic skills."
  72. if finalNumber == 9:
  73. numberMeaning = "a selfless, generous individual, never afraid to give to those around them."
  74.  
  75. 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