Skip to content
Snippets Groups Projects
Commit fb952119 authored by ves3508's avatar ves3508
Browse files

Lab 4

parent 85cfb174
Branches
No related tags found
No related merge requests found
File added
import random
print("This is a password generator.")
print("Everyone is different so we are going to ask you some personal questions and generate a password with your given answers.\n")
ansOne = input("Why does your best friend make you happy?\n")
ansTwo = input("What's the best compliment you've ever recieved?\n")
ansThree = input("Where is your favorite place to be?\n")
def strChange(a):
a = a.strip()
a = a.split(" ")
b = a[random.randint(0,len(a)-1)]
b += a[random.randint(0,len(a)-1)]
return b
a = strChange(ansOne)
b = strChange(ansTwo)
c = strChange(ansThree)
password = b + a + c
print(password)
import random
print("This is a password generator.")
print("Everyone is different so we are going to ask you some personal questions and generate a password with your given answers.\n")
ansOne = input("Why does your best friend make you happy?\n")
ansTwo = input("What's the best compliment you've ever recieved?\n")
ansThree = input("Where is your favorite place to be?\n")
def removeStr(a):
if "I" in a:
a.remove("I")
if "and" in a:
a.remove("and")
if "you" in a:
a.remove("you")
if "we" in a:
a.remove("we")
if "they" in a:
a.remove("they")
return a
def strChange(a):
a = a.strip()
a = a.split(" ")
a = removeStr(a)
b = a[random.randint(0,len(a)-1)]
b += a[random.randint(0,len(a)-1)]
return b
a = strChange(ansOne)
b = strChange(ansTwo)
c = strChange(ansThree)
password = b + a + c
print(password)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment