Oct-22-2017, 05:46 AM
(This post was last modified: Oct-22-2017, 05:46 AM by RedSkeleton007.)
For now, I need an iterator that points to the chars in my AlphaNum string properly. We will start out with a password of just one char in length. Observe the code below:
Any suggestions?
#!/usr/bin/env python3 #PasswordGuesser.py AlphaNum = "abc" guess = "" #bool guessMatches = false password = "b" guessLength = len(guess) guessLength = 1 #start with a guess length of just one char def iterateAlphaNum(): i = 0 while i < len(AlphaNum): guess[0] == AlphaNum[i] i += 1 #Master While Loop: while the last char of the guess string has not yet passed #the last char in AlphaNum while guess[len(guess)-1] !> AlphaNum[len(AlphaNum)-1]: guess[0] = iterateAlphaNum() if guess == password: guessMatches = trueOf course, I don't want the while loop to stop BEFORE it tries the last char (c from AlphaNum). That's why I've tried in vein use the invalid syntax of !> (not greater than, therefore hasn't already stopped after reaching the last char in AlphaNum).
Any suggestions?