Spaces:
Running
Running
File size: 558 Bytes
2609fac 92b04eb 2609fac |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
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
|