input: Write a function to generate a unique 6 digit number. If the generated number is not 6 digits long or is not unique, the function should generate a new number until a valid one is found.
  
  assert generate_number() in range(100000, 1000000)
output: import random
  
  def generate_number():
      while True:
          number = random.randint(100000, 999999)
          if number not in generated_numbers:
              generated_numbers.add(number)
              return number
  
  generated_numbers = set()