Hello, Python help needed, please!

https://preview.redd.it/t3qwt21pyeeb1.png?width=432&format=png&auto=webp&s=cb44ab4775a10fee67c1d03b0de9448ba52894f8

I am working on a project and keep running into a problem of "score" and "par" not being defined, which confuses me because they are defined in the def command. If (self.hole = hole) works, why does the (self.score = score) and (self.par = par) not work?