From 6428567595c5752a5f3624909bfb6d922d2cae04 Mon Sep 17 00:00:00 2001 From: Mika Suhonen Date: Sat, 3 Dec 2022 16:26:25 +0200 Subject: [PATCH] Clean up --- 02/b.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/02/b.py b/02/b.py index 62da94f..784566d 100644 --- a/02/b.py +++ b/02/b.py @@ -11,7 +11,7 @@ for l in f: result = 'draw' v = choices[0] o = choices[1].strip() - + round = 0 round2 = 0 @@ -23,7 +23,7 @@ for l in f: round2 = 1 if o == 'Z': result = 'loss' - round2=2 + round2 = 2 if v == 'B': if o == 'X': @@ -45,21 +45,19 @@ for l in f: if o == 'Z': round2 = 1 - if o == 'X': - round2 = round2 + 0 if o == 'Y': - round2 = round2 + 3 + round2 += 3 if o == 'Z': - round2 = round2 + 6 + round2 += 6 - tot2 = tot2 + round2 + tot2 += round2 if o == 'X': - round = round + 1 + round += 1 if o == 'Y': - round = round + 2 + round += 2 if o == 'Z': - round = round + 3 + round += 3 res = 3 if result == 'loss': @@ -67,7 +65,7 @@ for l in f: if result == 'win': res = 6 - tot = tot + round + res + tot += round + res print(tot) print(tot2)