I am just learning classes in Python and for the past day I am stuck with the below.
I am trying to use a user input (from the main() function) to change the value of an attribute in the class.
I have been throught the @property and @name.setter methods that allow you to change the value of a private attribute.
However I am trying to find out how you can use user input to change the value of an attribute that is not private.
I came up with the below but it does not seem to work. The value of the attribute remains the same after I run the program. Would you have any ideas why?
def __init__(self, loud, choice = ""):
self.loud = loud
self.choice = choice
self.choice = input("Choose what you want: ")
self.loud == self.choice
john = Person(loud = 100)