Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random #for challenge3
- #challenge1#
- def haiku():
- for item in poem:
- print(item)
- #Challenge2
- def singsong(name):
- for i in range (4):
- print("Happy birthday dear " + name)
- #challenge3
- def list():
- charactertype = ["caps", "lowercase", "symbols", "nums", "characters"]
- characterlist = random.choice(charactertype)
- return characterlist
- def accesscode(pass_size):
- caps = ["A", "B", "C", "D", "Z"]
- lowercase =["a", "b", "c", "d", "e", "z"]
- symbols = ["e3","s2","i1"]
- nums = [0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9]
- password =[]
- for i in range(pass_size):
- characterlist = list()
- item = random.choice(characterlist)
- print(item)
- password.append(item)
- return password
- poem = ["an aging willow—", "its image unsteady", "in the flowing stream"]
- print("Below is a haiku poem:")
- print("************************")
- haiku()
- print("\n")
- name = input("Enter birthday name to sing happy birthday to >")
- singsong(name)
- print("\n")
- pass_size = int(input("Enter the required lenght of your password >"))
- password = accesscode(pass_size)
- 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