Oct-02-2019, 09:40 PM
Good afternoon...
Can someone please show me what I am missing. Basically I want to take an argument in and check if it exists within a tuple of valid arguments. If it does GREAT, if not raise an error that tells the user to try again.....
Thanks
Can someone please show me what I am missing. Basically I want to take an argument in and check if it exists within a tuple of valid arguments. If it does GREAT, if not raise an error that tells the user to try again.....
_SCOPE_VARIABLES = ('open', 'read', 'write', 'query', 'close') class command: def __init__(self, command, scope = 'NONE', **kwargs): self.command = command self.scope = scope try: self.scope in _SCOPE_VARIABLES except: print ('Try again')
Thanks