rapid introduction to procedural programming ter in this subsection we will concentrate on console /oand use shell redirection for reading and writing files python provides the built-in input(function to accept input from the user this function takes an optional string argument (which it prints on the console)it then waits for the user to type in response and to finish by pressing enter (or returnif the user does not type any text but just presses enterthe input(function returns an empty stringotherwiseit returns string containing what the user typedwithout any line terminator here is our first complete "usefulprogramit draws on many of the previous pieces--the only new thing it shows is the input(functionprint("type integerseach followed by enteror just enter to finish"total count while trueline input("integer"if linetrynumber int(lineexcept valueerror as errprint(errcontinue total +number count + elsebreak if countprint("count ="count"total ="total"mean ="total countbook' examples the program (in file sum py in the book' exampleshas just executable lines here is what typical run looks liketype integerseach followed by enteror just enter to finish number number number invalid literal for int(with base ' xnumber number numbercount total mean although the program is very shortit is fairly robust if the user enters string that cannot be converted to an integerthe problem is caught by an