function takes in all three parts of name and then builds string out of them the function adds spaces where appropriate and converts the full name to title casejohn lee hooker but middle names aren' always neededand this function as written would not work if you tried to call it with only first name and last name to make the middle name optionalwe can give the middle_name argument an empty default value and ignore the argument unless the user provides value to make get_formatted_name(work without middle namewe set the default value of middle_name to an empty string and move it to the end of the list of parametersu def get_formatted_name(first_namelast_namemiddle_name='')"""return full nameneatly formatted "" if middle_namefull_name first_name middle_name last_name elsefull_name first_name last_name return full_name title(musician get_formatted_name('jimi''hendrix'print(musicianx musician get_formatted_name('john''hooker''lee'print(musicianin this examplethe name is built from three possible parts because there' always first and last namethese parameters are listed first in the function' definition the middle name is optionalso it' listed last in the definitionand its default value is an empty string in the body of the functionwe check to see if middle name has been provided python interprets non-empty strings as trueso if middle_name evaluates to true if middle name argument is in the function call if middle name is providedthe firstmiddleand last names are combined to form full name this name is then changed to title case and returned to the function call line where it' stored in the variable musician and printed if no middle name is providedthe empty string fails the if test and the else block runs the full name is made with just first and last nameand the formatted name is returned to the calling line where it' stored in musician and printed calling this function with first and last name is straightforward if we're using middle namehoweverwe have to make sure the middle name is the last argument passed so python will match up the positional arguments correctly functions