Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. import random #for challenge3
  2. #challenge1#
  3. def haiku():
  4. for item in poem:
  5. print(item)
  6.  
  7. #Challenge2
  8. def singsong(name):
  9. for i in range (4):
  10. print("Happy birthday dear " + name)
  11.  
  12. #challenge3
  13. def list():
  14. charactertype = ["caps", "lowercase", "symbols", "nums", "characters"]
  15. characterlist = random.choice(charactertype)
  16. return characterlist
  17.  
  18. def accesscode(pass_size):
  19. caps = ["A", "B", "C", "D", "Z"]
  20. lowercase =["a", "b", "c", "d", "e", "z"]
  21. symbols = ["e3","s2","i1"]
  22. nums = [0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9]
  23. password =[]
  24. for i in range(pass_size):
  25. characterlist = list()
  26. item = random.choice(characterlist)
  27. print(item)
  28. password.append(item)
  29. return password
  30.  
  31. poem = ["an aging willow—", "its image unsteady", "in the flowing stream"]
  32. print("Below is a haiku poem:")
  33. print("************************")
  34. haiku()
  35. print("\n")
  36. name = input("Enter birthday name to sing happy birthday to >")
  37. singsong(name)
  38. print("\n")
  39.  
  40. pass_size = int(input("Enter the required lenght of your password >"))
  41. password = accesscode(pass_size)
  42. print("here is the password that has been generated for you with " + str(pass_size) + " characters : ", password)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement