appendix python review smithjohn the first line is an integer identification numberthe second is the name of the student stored as text stringand the last line is the student' average computed as floating-point value to extract the informationeach line must be read as string and the two numeric values must be explicitly converted to the appropriate numeric type idnum intinfile readline(name (infile readline()rstrip(avg floatinfile readline(typicallythe newline character should be removed from strings that are part of data records otherwiseproblems can occur when processing the stringsas would be the case when performing string comparison the removal of the newline character can be combined with the extraction as shown in the above code segmentor performed as two separate operations user-defined functions python allows users to define their own functions that can be used like any other built-in or library function functions allow for the subdivision of larger problems into smaller parts and for the reuse of code in this sectionwe review the creation and use of user-defined functions the function definition python function contains header and body the function header is specified using the def keyword while the function body is given as statement block the header consists of name by which the function can be called and parenthesized comma-separated list of formal parameters consider the following code segmentdef sumrangefirstlast )total first while <last total total return total that defines the function sumrange()which requires two arguments the function sums the range of values specified by the first and last numeric arguments and returns the result user-defined function is called like any other function in pythonas illustrated in the following code segmentthesum sumrange print"the sum of the first integers is"thesum