Python Object-Oriented Python Dice Roller Yatzy Scoring

Riya Chatterjee
Riya Chatterjee
7,582 Points

Why is it "_score_set"?

Why is there a single underscore before score set in I don't understand if that's a type of special convention, or why it's necessary here.

1 Answer

The underscore prefix simply means that it is for internal use . It is the convention defined in PEP 8 but not necessarily enforced by Python . Unlike in java , python does not have strong hints between private and public variables . So a single underscore is used to make a distinction that * the variable is private(internal use only).*