code: def generate_password(length=8, lower=True, upper=True, number=True):
      
      lletters = "abcdefghijklmnopqrstuvwxyz"
      uletters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
      # This doesn't guarantee both lower and upper cases will show up
      alphabet = lletters + uletters
      digit = "0123456789"
      mypw = ""
  
      def _random_character(texts):
          return texts[random.randrange(len(texts))]
  
      if not lower:
          alphabet = uletters
      elif not upper:
          alphabet = lletters
  
      for i in range(length):
          # last half length will be filled with numbers
          if number and i >= int(length / 2):
              mypw = mypw + _random_character(digit)
          else:
              mypw = mypw + _random_character(alphabet)
      return mypw
docs: generates a simple password. We should not really use this in production.
      :param length: the length of the password
      :param lower: True of lower case characters are allowed
      :param upper: True if upper case characters are allowed
      :param number: True if numbers are allowed
      :return: