we're using dictionary key references in the format string this time--recall that (name) means pull out the value for the key name in the data dictionary and perform to-string conversion on its value multiple-choice fields we're also testing the type of all the expected fieldsvalues to see whether they arrive as list rather than the usual string values of multiple-choice input controlslike the language choice field in this input pageare returned from cgi fieldstorage as list of objects with value attributesrather than simple single object with value this script copies simple field values to the dictionary verbatimbut it uses list comprehension to collect the value fields of multiple-choice selectionsand the string join method to construct single string with an and inserted between each selection value ( python and tclthe script' list comprehension is equivalent to the call map(lambda xx valueform[field]not shown herethe fieldstorage object' alternative methods getfirst and getlist can also be used to treat fields as single and multiple itemswhether they were sent that way or not (see python' library manualsand as we'll see laterbesides simple strings and listsa third type of form input object is returned for fields that specify file uploads to be robustthe script should really also escape the echoed text inserted into the html replylest it contain html operatorswe will discuss escapes in detail later when the form page is filled out and submittedthe script creates the response shown in figure - --essentially just formatted echo of what was sent changing input layouts suppose that you've written system like that in the prior sectionand your usersclientsand significant other start complaining that the input form is difficult to read don' worry because the cgi model naturally separates the user interface (the html input page definitionfrom the processing logic (the cgi script)it' completely painless to change the form' layout simply modify the html filethere' no need to change the cgi code at all for instanceexample - contains new definition of the input that uses tables bit differently to provide nicer layout with borders example - pp \internet\web\tutor html cgi common input devicesalternative layout use the same tutor py server side scriptbut change the layout of the form itself notice the separation of user interface and processing logic herethe cgi script is independent of the html used to interact with the user/client server-side scripting