if len(note) not in range(2, 5):
msg = "string of 2 to 4 characters expected, got {:d} ({:s})"
raise ValueError(msg.format(len(note), note))
if len(note) not in range(2, 5):
msg = "string of 2 to 4 characters expected, got {:d} ({:s})"
raise ValueError(msg.format(len(note), note))