im a pretty new (and bad) at python, and I was just wondering if there is anyone who can help me simplify a if/elif block. It's a super basic code, which basically asks what someone wants in a password and then randomises a pswd for them. But there are options if the user wants uppercase and numbers.
if upper == True and numbers == True:
lettersAndDigits = string.ascii_letters + string.digits
elif upper == True and numbers == False:
lettersAndDigits = string.ascii_letters
elif upper == False and numbers == True:
lettersAndDigits = string.ascii_lowercase + string.digits
elif upper == False and numbers == False:
lettersAndDigits = string.ascii_lowercase
sorry for the noob question guys
thanks a bunch guys, this has really helped :)
just reviewing for my igcse's and Im trying to relearn proper procedure. my teacher isn't that strong in python