the prompt_init static method is now getting dictionary values from the parent classand then adding some additional values of its own it calls the dict update method to merge the new dictionary values into the first one howeverthat prompt_init method is looking pretty uglyit loops twice until the user enters valid input using structurally similar code but different variables it would be nice to extract this validation logic so we can maintain it in only one locationit will likely also be useful to later classes with all the talk on inheritancewe might think this is good place to use mixin insteadwe have chance to study situation where inheritance is not the best solution the method we want to create will be used in static method if we were to inherit from class that provided validation functionalitythe functionality would also have to be provided as static method that did not access any instance variables on the class if it doesn' access any instance variableswhat' the point of making it class at allwhy don' we just make this validation functionality module-level function that accepts an input string and list of valid answersand leave it at thatlet' explore what this validation function would look likedef get_valid_input(input_stringvalid_options)input_string +({}format("join(valid_options)response input(input_stringwhile response lower(not in valid_optionsresponse input(input_stringreturn response we can test this function in the interpreterindependent of all the other classes we've been working on this is good signit means different pieces of our design are not tightly coupled to each other and can later be improved independentlywithout affecting other pieces of code get_valid_input("what laundry?"("coin""ensuite""none")what laundry(coinensuitenonehi what laundry(coinensuitenonecoin 'coinnowlet' quickly update our apartment prompt_init method to use this new function for validationdef prompt_init()parent_init property prompt_init(laundry get_valid_input