So after doing the beginner “Hello World” program in Python, I thought I should up my game a bit. Today I was travelling down to some meetings so I figured this out on the train. The biggest issue I’m having with Python at the moment is keeping it all lower case. So I dusted off some old stuff I wrote in a previous life. I’m probably going to keep working on this to make it neater and more polished, but as the first project in Python, I think it’s a good start.

import random
complexity = input("How complex do you want your password to be 1 - 3? ")
if complexity == "1":
seed = str_simple
elif complexity == "2":
seed = str_complex
seed = str_insane
slen = len(seed)
def makePassword ():
i = 1
plen = 15
strpass = ""
while i < 15:
#rannum = int((random.random()*slen)+1)
strpass = strpass + seed[int((random.random()*slen)+1)]
i += 1
return strpass