builder pattern def build_html_form(field_list)with open("form_file html"' 'as ff write"{}formatgenerate_webform(field_listif __name__ ="__main__"field_list "type""text_field""label""best text you have ever written""name""best_text}"type""checkbox""id""check_it""value"" ""label""check for one"}"type""text_field""label""another text field""name""text_field build_html_form(field_listthe if statements are still therebut at least now the code is little cleaner these sprawling if statements will keep growing as we add more field types to the form generator let' try to better the situation by using an object-oriented approach we could use polymorphism to deal with some of the specific fields and the issues we are having in generating them