def test_sequence(value):
 try:
  len(value)
  value.__getitem__
 except:
  return False
 return True

def test_sequence ( value ) : try : len ( value ) value . __getitem__ except : return False return True
return true if the variable is a sequence .