I would like to check if a string s is in a given list valid_string. If not, I want to throw an error.
valid_string = ['abc', 'def', 'ghi']
s = 'test'
if s not in valid_string:
# Throw error: ('"{}" is not a valid string. Valid strings are {}'.format(s, valid_string))
What's best practice in order to throw the error?