mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-24 03:54:20 +00:00
Fix divisionbyzero
This commit is contained in:
parent
38c9d1f019
commit
d6a306036a
1 changed files with 2 additions and 0 deletions
|
@ -34,6 +34,8 @@ class TriviaScore:
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def correct_rate(self):
|
def correct_rate(self):
|
||||||
|
if self.total_answers == 0:
|
||||||
|
return 0.0
|
||||||
return self.correct_answers / self.total_answers
|
return self.correct_answers / self.total_answers
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
Loading…
Reference in a new issue