New to python and having which is probably a basic issue when trying to get a loop to work.
I have read some previous questions similar but couldn't find a solution that works.
I'm just trying to get the same question asked in the script until a listed cat name is mentioned. So If a enter a name like 'Scott' which is not in the list of pets it will ask to try again for a pet name again.
myPets = ['Zophie', 'Pooka', 'Fat-tail']
print('Enter a pet name.')
name = input()
if name not in myPets:
print('I do not have a pet named ' + name + ' try again')
else:
print(name + ' is my pet.')
iftowhile, and remove theelsede-indenting the lastprint(). Finally, update thenameinside the while with anotherinput()raw_input()so that you don't have to wrap your input with " marks always ;)