Thanks for taking the time to ready thru my question.
At the moment I'm creating a method for a class, and below is what I've got so far.
def scramble_words_password(self, words):
if words:
words = words.split()
words_count = range(len(words))
while True:
num = random.choice(words_count)
del(words_count[num])
password = [letter for letter in list(words[num])]
A few months ago i came across a tutorial, that explained how to assing functions to variables, and use something like random on them but i cant find it again...
What I want in my function/method is a way to randomly use letter.lower() and letter.upper() on the comprehension on the bottom line of my function/method, but how can i achieve that and still keep it all in the comprehension.
FYI, I know that the function ATM is an infinity loop, so no smart remarks please ;)