This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
valid_range = range(0, 10) | |
def check_list(l): | |
return type(l) == list and len(l) == 9 | |
def check_values(l): | |
counts_ok = not any([l.count(e) - 1 for e in l if e != 0]) | |
ranges_ok = (len([e for e in l if e in valid_range]) == len(l)) | |
return counts_ok and ranges_ok |