I'm  designing a UML class diagram for a Mastermind game and I'm having trouble figuring out how to make the attribute 'Name' unique and not changeable. I'm assuming that I do this by naming the 'Name' attribute private and show it in the class diagram as well. Any sort of help would be highly appreciated. Thanks
As per Python you can only indicate private attributes by adding an underscore in front of the name. Language-wise this is not a language construct but a convention. UML does not care since it's language-agnostic. Model it as private (by showing the - in front of the name). If you are generating code from that UML model the code generator might create the underscore automatically.
In any case, if you create a model with UML and indicate something to be private then the coder for the language must take care. For a closed implementation you just need to train your coders. For an open (library) implementation Python will let you stand in the rain with that.
Username must be unique and can't be changed in Mastermind