def onClick(self, sender):
        found = False
        if sender == self.cmdNew:
            self.blanks = ''
            self.hangdude.clear()
            self.guesses = 0
            self.score = 0
            for i in range(len(self.key_widgets)):
                self.key_widgets[i].setEnabled(True)
            if self.level == 5: 
                words = Wordlist_5.words
            elif self.level == 10: 
                words = Wordlist_10.words
            elif self.level == 15: 
                words = Wordlist_15.words
            elif self.level == 20: 
                words = Wordlist_20.words
            #pick a random word
            g = random.Random()
            r = int( g.random() * len(words))
            self.answer = words[r].upper()
            for i in range(len(self.answer)):
                if self.answer[i] == ' ':
                    self.blanks += '  '
                else:
                    self.blanks += '_ '
            self.puzzlestring.setHTML(self.blanks)
        else:
            guess_letter = sender.getText()
            sender.setEnabled(False)
            for i in range(len(self.answer)):
                if self.answer[i:i+1] == guess_letter:
                    j=i+1
                    self.blanks = self.blanks[0:(j*2)-2] + guess_letter + ' ' + self.blanks[j*2:]
                    found = True
                    self.score += 1
            self.puzzlestring.setHTML(self.blanks)
            if not found:
                self.guesses += 1
                self.hangdude.draw(self.guesses)
                if 11 >= self.guesses:
                    Window.alert("You lose! Answer: " + self.answer)
            else:
                if self.score >= len(self.answer):
                    Window.alert("You win!")
dataset/ETHPy150Open anandology/pyjamas/examples/hangman/HangManWidget.py/HangManWidget.onClick/swapped operands of `>=`