Private and protected methods in Python; how will you declare a private variable?
Asked in the round 1 stage. Implement demonstrate_encapsulation(secret) to show Python's encapsulation conventions.
The function must define a CredentialVault class with a private variable __secret, a private method __is_valid, and a protected method _mask_secret. Its public method must return a dictionary containing the masked secret, whether the private variable is stored under its name-mangled form, and whether the secret is valid. Preserve the final two characters when the secret has at least two characters; mask all other characters with *. For shorter secrets, mask every character.
Input is a non-empty string secret. Return a dictionary with keys masked, private_declared, and valid.
def demonstrate_encapsulation(secret):