Is it possible that this should return ```True```? Here ```q = 0``` will result in a ```continue```, whereas in the case ```b != 1``` it will not. Also, you could move this ```if``` statement to the beginning of the function.