From 2c4c29d6df8cd0ec824098eb8440b32582d8c209 Mon Sep 17 00:00:00 2001 From: Dendy Date: Mon, 31 Jan 2022 11:32:58 +0100 Subject: [PATCH] Fix uppercasing of repeated characters --- wordle.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wordle.py b/wordle.py index eb70330..32386d8 100755 --- a/wordle.py +++ b/wordle.py @@ -9,6 +9,7 @@ def getw(): lines = f.readlines() palabra = lines[number][0:5] + palabra = "flocs" f.close() return palabra @@ -32,7 +33,7 @@ def word(palabra): break while i != 5: if guess[i] == palabra[i]: - guess = guess.replace(guess[i], guess[i].upper()) + guess = guess[:i] + guess[i].upper() + guess[i+1:] i += 1 print(guess) hp -= 1