rapid introduction to procedural programming if the conversion succeedswe use number as an index into the digits listfrom which we extract the digit list of strings we then add the row-th string from this list to the line we are building upand also append two spaces to give some horizontal separation between each digit each time the inner while loop finisheswe print the line that has been built up the key to understanding this program is where we append each digit' row string to the current row' line try running the program to get feel for how it works we will return to this program in the exercises to improve its output slightly |generate_grid py one frequently occurring need is the generation of test data there is no single generic program for doing thissince test data varies enormously python is often used to produce test data because it is so easy to write and modify python programs in this subsection we will create program that generates grid of random integersthe user can specify how many rows and columns they want and over what range the integers should span we'll start by looking at sample rungenerate_grid py rows invalid literal for int(with base ' xrows columns minimum (or enter for )- maximum (or enter for ) - - - - - the program works interactivelyand at the beginning we made typing error when entering the number of rows the program responded by printing an error message and then asking us to enter the number of rows again for the maximum we just pressed enter to accept the default we will review the code in four partsthe importthe definition of get_int(function ( more sophisticated version than the one shown in piece # )the user interaction to get the values to useand the processing itself import random random randint( we need the random module to give us access to the random randint(function