title: I couldn't find any solutions for my TypeError: object of type 'bool' has no len() error
body: <p>In this code below here, i wanted to create a guessing game. Player enters 4 numbers and the computer tells the player how many numbers are correct. But when i run the program, just after I input a number it gives me "TypeError: object of type 'bool' has no len()" error. I've read about this error but I couldn't find any solutions. Any help to solve? And how to solve please?</p>
  
  <pre><code>import random
  
  numbers = int(random.randrange(1000,9999))
  nums = [int(x) for x in str(numbers)]
  
  while True:
      try:    
          guess = int(input('Enter your guess: '))
          mynumbers = [int(k) for k in str(guess)]
          i = 0
  
          if int(guess) == int(numbers):
              print('Congragulations, you have guessed the number!')
              print('It took [] tries to guess')
              break
          else:
              a = len((mynumbers) in (nums))
              print ('*' * a)
  
              i+=1
              continue
      except ValueError:
          print('Please enter a number.')
          continue
  </code></pre>