class User:
    def __init__(self, password):
        self._password = password

    def get_password(self):
        return "비밀번호는 직접 확인할 수 없습니다."

    def set_password(self, new_password):
        if len(new_password) < 8:
            print("비밀번호는 8자 이상이어야 합니다.")
        else:
            self._password = new_password
            print("비밀번호가 변경되었습니다.")

user = User("12345678")

print(user.get_password())     
user.set_password("1234")      
user.set_password("newpass123")

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: