Skip to content

Instantly share code, notes, and snippets.

@rwilcox
Created October 9, 2018 23:35
Show Gist options
  • Save rwilcox/75feb11d8980576ac5cb64bc6befe653 to your computer and use it in GitHub Desktop.
Save rwilcox/75feb11d8980576ac5cb64bc6befe653 to your computer and use it in GitHub Desktop.
#from faker import Faker
#fake = Faker('en_US')
#print fake.words() # sentence() #bs() # catch_phrase()
import requests
import random
def main():
a = requests.get("http://www.desiquintans.com/downloads/nounlist/nounlist.txt")
word_list = a.text.split('\n')
all_lines = ask_and_respond(word_list)
present(all_lines)
#print(all_lines)
# print(" ".join(all_lines))
def ask_and_respond(potential_words):
output=[]
l = input("What is the security question?")
if len(l) == 0:
return None
for current in range(1, 6):
output.append( random.choice(potential_words) )
answer_str = " ".join( output )
print("Q: ", l)
print("A: ", answer_str)
# todo: ask them id they used that phrase or customized it, record result
next_list = ask_and_respond(potential_words)
if next_list:
lst = [l, output ]
lst.extend( next_list)
return lst
else:
return [l, output]
def present(qs_and_as):
# TODO: implement me
print(qs_and_as)
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment