Spaces:
Sleeping
Sleeping
import uuid | |
def points_to_mark(good, total): | |
percents = good / total * 100 | |
if percents < 50: | |
return 2 | |
elif percents < 66: | |
return 3 | |
elif percents < 90: | |
return 4 | |
else: | |
return 5 | |
def answer_letter(answer, variants): | |
answer = answer.lower() | |
for var in variants: | |
letter, var = var.split(') ') | |
if var == answer: | |
return letter + ') ' + answer | |
def is_valid_uuid(value): | |
try: | |
uuid.UUID(str(value)) | |
return True | |
except ValueError: | |
return False | |