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