1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

Fix divisionbyzero

This commit is contained in:
Steffo 2020-01-17 17:55:18 +01:00
parent 38c9d1f019
commit d6a306036a

View file

@ -34,6 +34,8 @@ class TriviaScore:
@property
def correct_rate(self):
if self.total_answers == 0:
return 0.0
return self.correct_answers / self.total_answers
@property