From 77851ded7d4499c8fdd5adfe62610ed1713cedb0 Mon Sep 17 00:00:00 2001 From: spla Date: Sat, 5 Dec 2020 16:31:26 +0100 Subject: [PATCH] Fix #12 --- mastochess.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mastochess.py b/mastochess.py index 0809dd2..db79da0 100644 --- a/mastochess.py +++ b/mastochess.py @@ -32,7 +32,14 @@ def unescape(s): def create_panel(username, played_games, wins): - ratio = round((wins * 100) / played_games, 2) + if played_games > 0 and wins > 0: + + ratio = round((wins * 100) / played_games, 2) + + else: + + ratio = 0 + x = 10 y = 10