def create_password(self, arg):
        """The player is choosing a password for their new character.
        
        PREV STATE: self.new_playername OR self.verify_new_character
        NEXT STATE: This state will repeat until a password has been chosen and
                    confirmed, then will change to self.choose_gender
        """
        if not self.password:
            if arg in BAD_PASSWORDS:
                self.player.update_output(CLEAR + '\r\nThat\'s a reserved word. Pick a different password: ' + CONCEAL)
            else:    
                self.password = hashlib.sha1(arg).hexdigest()
                self.player.update_output(CLEAR + 'Re-enter your password to confirm: ' + CONCEAL)
        else:
            if self.password == hashlib.sha1(arg).hexdigest():
                self.save['password'] = self.password
                if not self.newbie:
                    self.player.update_output(CLEAR + "Your new password has been saved.")
                    self.state = self.character_cleanup
                else:
                    self.next_state = self.choose_gender
                    self.player.update_output(CLEAR + "What gender shall your character be? " +\
                                                    "Choose from: neutral, female, or male.")
                    self.player.update_output('Gender: ')
            else:
                self.player.update_output(CLEAR + 'Passwords did not match.')
                self.player.update_output('Please choose a password: ' + CONCEAL)
                self.password = None
dataset/ETHPy150Open shinymud/ShinyMUD/src/shinymud/modes/init_mode.py/InitMode.create_password/original