title: Beginner programmer: Password generator
body: <p>As the title says, I am absolutely new to programming. I'm getting horribly stuck unfortunately. I have to make a random password generator using the ASCII table. I am NOT allowed to import string, nor am I allowed to use an alphabet string and select characters from it, I am only allowed to use CHR or ORD functions, lists and other very basic level functions that I have been taught in class. I am encouraged to define my own function.</p>
  
  <p>I got the code to work briefly but it was executing each option 3 times each and therefore going way over the character count of 7-14. So instead I have tried a variable that has three choices which is supposed to execute either an uppercase, lowercase or number depending on what it gets. This is my code so far:</p>
  
  <pre><code>for loop in range(10):
  
      import random
  
      password = ""
      randLength = random.randint(7, 14)
  
      lower = random.randint(97, 122)
      upper = random.randint(65, 90)
      number = random.randint(0, 9)
  
      for n in range(randLength):
          randChoice = random.randint(1, 3)
          if randChoice == 1:
              choice = lower
          elif randChoice == 2:
              choice = upper
          else:
              choice = number
          result = chr(lower) + chr(upper) + str(number)
      password += result
  
      print(password)
  </code></pre>
  
  <p>As of now my coding is printing one lowercase, one uppercase and one number (in that exact same order every single time), but it won't repeat the process to reach a desired random length of 7-14, nor do I want it to remain in the same 'pattern' every time, it's meant to be random after all.</p>
  
  <p>How would I also modify my code to prevent two identical characters appearing side by side in my output? Please help a newbie! Thanks</p>