You need to do it this way, if i am correct to assume this is your purpose:
petname = ['Zophie', 'Pooka', 'Fat-tail']
print ('What is your pets name?')
name = input()
if name not in petname:
print ('Your pet is not in the list')
else:
print ('Your pet is in the list')
solved Syntax error on if in Python